line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MMM::Report; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2313
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
148
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
62
|
|
5
|
2
|
|
|
2
|
|
9
|
use base qw(MMM); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1443
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
MMM::MirrorQueue |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 METHODS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
0
|
|
|
0
|
1
|
|
my ($class, @args) = @_; |
17
|
0
|
0
|
|
|
|
|
my $mmm = $class->SUPER::new(@args) or return; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
if (!$mmm->{nofork}) { |
20
|
0
|
|
|
|
|
|
Sys::Syslog::openlog('mmm', 'pid', $mmm->configval('default', 'syslog_facilities', 'daemon')); |
21
|
0
|
|
|
|
|
|
$mmm->{use_syslog} = 1; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
$mmm |
25
|
0
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 header |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Return the string to show at the beginning |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
|
sub header { |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 body |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
1
|
|
sub body { |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 body_queue |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Return a string about body of each queue |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
1
|
|
sub body_queue { |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 footer |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Return the string to show at the end |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
0
|
1
|
|
sub footer { |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 run |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The main routine |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub run { |
68
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
69
|
0
|
|
|
|
|
|
foreach my $q ($self->get_tasks_by_name($self->list_tasks)) { |
70
|
0
|
|
|
|
|
|
push(@{$self->{tasks}}, [ $q, { $q->state_info() } ]); |
|
0
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
} |
72
|
0
|
|
|
|
|
|
$self->header(); |
73
|
0
|
0
|
|
|
|
|
foreach my $q (sort { $a->[0]->name cmp $b->[0]->name } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
@{$self->{tasks} || []}) { |
75
|
0
|
0
|
|
|
|
|
$q->[0]->is_disable and next; |
76
|
0
|
0
|
|
|
|
|
$self->body_queue($q->[0], %{ $q->[1] || {} }); |
|
0
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
} |
78
|
0
|
|
|
|
|
|
$self->footer(); |
79
|
0
|
|
|
|
|
|
$self->{tasks} = undef; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |