line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::MadEye::Plugin::Worker::Simple; |
2
|
2
|
|
|
2
|
|
2381
|
use strict; |
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
80
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
67
|
|
4
|
2
|
|
|
2
|
|
11
|
use base qw/App::MadEye::Plugin::Base/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1058
|
|
5
|
2
|
|
|
2
|
|
17
|
use App::MadEye::Util; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
130
|
|
6
|
2
|
|
|
2
|
|
10
|
use Params::Validate; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
521
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub run_job :Method { |
9
|
0
|
|
|
0
|
0
|
|
my ($self, $context, $args) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
$context->log( debug => "watching $args->{target} by $args->{plugin}" ); |
12
|
|
|
|
|
|
|
|
13
|
0
|
0
|
|
|
|
|
my $timeout = $self->config->{config}->{task_timeout} or die "missing task_timeout"; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $error = timeout $timeout, "watching $args->{target} $args->{plugin}", sub { |
16
|
0
|
0
|
|
0
|
|
|
if ( my $message = $args->{plugin}->is_dead( $args->{target} ) ) { |
17
|
0
|
|
|
|
|
|
$context->add_result( |
18
|
|
|
|
|
|
|
plugin => $args->{plugin}, |
19
|
|
|
|
|
|
|
target => $args->{target}, |
20
|
|
|
|
|
|
|
message => $message, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
} |
23
|
0
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if ($error) { |
26
|
0
|
|
|
|
|
|
$context->add_result( |
27
|
|
|
|
|
|
|
plugin => $args->{plugin}, |
28
|
|
|
|
|
|
|
target => $args->{target}, |
29
|
|
|
|
|
|
|
message => $error, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
$context->log( debug => "finished $args->{target} by $args->{plugin}" ); |
34
|
2
|
|
|
2
|
|
1979
|
} |
|
2
|
|
|
|
|
2885
|
|
|
2
|
|
|
|
|
12
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |