line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gearman::JobStatus; |
2
|
8
|
|
|
8
|
|
1106
|
use version (); |
|
8
|
|
|
|
|
1613
|
|
|
8
|
|
|
|
|
320
|
|
3
|
|
|
|
|
|
|
$Gearman::JobStatus::VERSION = version->declare("2.002.002"); #TRIAL |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
39
|
use strict; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
161
|
|
7
|
8
|
|
|
8
|
|
27
|
use warnings; |
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
1645
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Gearman::JobStatus - represents a job status in gearman distributed job system |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
L get_status($handle) returns I for a given handle |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 METHODS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
7
|
|
|
7
|
0
|
5012
|
my ($class, $known, $running, $nu, $de) = @_; |
23
|
7
|
100
|
66
|
|
|
42
|
$nu = '' unless defined($nu) && length($nu); |
24
|
7
|
100
|
66
|
|
|
19
|
$de = '' unless defined($de) && length($de); |
25
|
|
|
|
|
|
|
|
26
|
7
|
|
|
|
|
22
|
return bless [$known, $running, $nu, $de], $class; |
27
|
|
|
|
|
|
|
} ## end sub new |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 known() |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
2
|
1
|
792
|
sub known { shift->[0]; } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 running() |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
1
|
676
|
sub running { shift->[1]; } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 progress() |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub progress { |
46
|
2
|
|
|
2
|
1
|
680
|
my $self = shift; |
47
|
2
|
100
|
|
|
|
9
|
return $self->[2] ne '' ? [$self->[2], $self->[3]] : undef; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 percent() |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub percent { |
55
|
3
|
|
|
3
|
1
|
1459
|
my $self = shift; |
56
|
3
|
100
|
66
|
|
|
24
|
return ($self->[2] ne '' && $self->[3]) |
57
|
|
|
|
|
|
|
? ($self->[2] / $self->[3]) |
58
|
|
|
|
|
|
|
: undef; |
59
|
|
|
|
|
|
|
} ## end sub percent |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |