lib/App/MadEye/Plugin/Worker/Simple.pm

filter: Statementstmt 67.8% 19 / 28 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 1 totaltotal 58.1% 25 / 43 CC 4 SCAR 15.9
CC
4
Cov
56%
run_job
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 4.9
« lib/App/MadEye.pm ↑ Summary lib/App/MadEye/Plugin/Notify/IMKayac.pm »
1 package App::MadEye::Plugin::Worker::Simple;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base qw/App::MadEye::Plugin::Base/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use App::MadEye::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub run_job :Method {
Subroutine run_job: not called CC=3 SCAR=24.8
Pod undocumented
9 0 my ($self, $context, $args) = @_;
10  
11 0 $context->log( debug => "watching $args->{target} by $args->{plugin}" );
12  
13 0 ▶ my $timeout = $self->config->{config}->{task_timeout} or die "missing task_timeout";
Branch: 1 branch
BranchTrueFalseTotal
my $timeout = $self->config->{"config"}{"task_timeout"} or die "missing task_timeout" 0 0 0
14  
15 0 ▶ my $error = timeout $timeout, "watching $args->{target} $args->{plugin}", sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
16 0 ▶ if ( my $message = $args->{plugin}->is_dead( $args->{target} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $message = $args->{"plugin"}->is_dead($args->{"target"})) 0 0 0
17 $context->add_result(
18 plugin => $args->{plugin},
19 target => $args->{target},
20 0 message => $message,
21 );
22 }
23 0 };
24  
25 0 ▶ if ($error) {
Branch: 1 branch
BranchTrueFalseTotal
if ($error) 0 0 0
26 $context->add_result(
27 plugin => $args->{plugin},
28 target => $args->{target},
29 0 message => $error,
30 );
31 }
32  
33 0 $context->log( debug => "finished $args->{target} by $args->{plugin}" );
34 2 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
35  
36 2 1;
37 __END__
« lib/App/MadEye.pm ↑ Summary lib/App/MadEye/Plugin/Notify/IMKayac.pm »