line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Monitis::CPU; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
|
|
|
|
|
|
require Carp; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base 'Monitis'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
738
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub add { |
10
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my @mandatory = qw/agentkey kernelMax usedMax name tag/; |
13
|
0
|
|
|
|
|
|
my @optional = qw/idleMin ioWaitMax niceMax/; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return $self->api_post('addCPUMonitor' => $params); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub edit { |
21
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my @mandatory = qw/testId kernelMax usedMax name tag/; |
24
|
0
|
|
|
|
|
|
my @optional = qw/idleMin ioWaitMax niceMax/; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return $self->api_post('editCPUMonitor' => $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('agentCPU' => $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('CPUInfo' => $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('cpuResult' => $params); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub get_top_results { |
65
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
68
|
0
|
|
|
|
|
|
my @optional = qw/timezoneoffset limit tag/; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
return $self->api_get('topcpu' => $params); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |