line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Monitis::LoadAverage; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
require Carp; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use base 'Monitis'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
778
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub add { |
10
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my @mandatory = qw/agentkey limit1 limit5 limit15 name tag/; |
13
|
0
|
|
|
|
|
|
my @optional = qw//; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return $self->api_post('addLoadAverageMonitor' => $params); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub edit { |
21
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my @mandatory = qw/testId limit1 limit5 limit15 name tag/; |
24
|
0
|
|
|
|
|
|
my @optional = qw//; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return $self->api_post('editLoadAverageMonitor' => $params); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get { |
32
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my @mandatory = qw/agentId/; |
35
|
0
|
|
|
|
|
|
my @optional = qw//; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return $self->api_get('agentLoadAvg' => $params); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_info { |
43
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my @mandatory = qw/monitorId/; |
46
|
0
|
|
|
|
|
|
my @optional = qw//; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $self->api_get('loadAvgInfo' => $params); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub get_results { |
54
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my @mandatory = qw/monitorId day month year/; |
57
|
0
|
|
|
|
|
|
my @optional = qw/timezone/; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return $self->api_get('loadAvgResult' => $params); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
1
|
|
sub topload1 { shift->get_top_results('topload1', @_) } |
65
|
0
|
|
|
0
|
1
|
|
sub topload5 { shift->get_top_results('topload5', @_) } |
66
|
0
|
|
|
0
|
1
|
|
sub topload10 { shift->get_top_results('topload10', @_) } |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub get_top_results { |
69
|
0
|
|
|
0
|
1
|
|
my ($self, $topload, @params) = @_; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
72
|
0
|
|
|
|
|
|
my @optional = qw/timezoneoffset limit tag/; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return $self->api_get($topload => $params); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |