line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crashplan::Client::ServerStatistics; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
40
|
use strict; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
275
|
|
4
|
8
|
|
|
8
|
|
37
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
8893
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.003_0'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crashplan::Client::ServerStatistics - Object representation of Crashplan PROe server's entity |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Crashplan::Client::ServerStatistics objects are instancied by Crashplan::Client. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Specifically, calling Crashplan::Client->parse_response after querying |
17
|
|
|
|
|
|
|
the server could produce Crashplan::Client::ServerStatistics |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Real-time statistics about what is happening inside the server. |
22
|
|
|
|
|
|
|
NOTE: Only administrators can access the serverStats resource |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 METHODS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 new |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
The Crashplan::Client::ServerStatistics constructor |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
35
|
1
|
|
50
|
|
|
5
|
my $param = shift || {}; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
3
|
my %converted_name = ( |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
2
|
my $self = $param; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
6
|
return bless $param,'Crashplan::Client::ServerStatistics'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 id |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Getter for the 'id" attribute. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub id { |
54
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
0
|
return $self->{id}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 creationDate |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Getter for the 'creationDate" attribute. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub creationDate { |
66
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
0
|
return $self->{creationDate}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 modificationDate |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Getter for the 'modificationDate" attribute. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub modificationDate { |
78
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
0
|
return $self->{modificationDate}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 diskUtilization |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The percentage of disk space used on the host OS bootdrive |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub diskUtilization { |
90
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
91
|
1
|
|
|
|
|
2
|
my $val = shift; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
5
|
return $self->{diskUtilization}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 seatCount |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
The number of active (versus deactivated) computers |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub seatCount { |
104
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
105
|
1
|
|
|
|
|
2
|
my $val = shift; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
1
|
|
|
|
|
4
|
return $self->{seatCount}; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 uptimeMilliseconds |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
The milliseconds this PRO Server has been running |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub uptimeMilliseconds { |
118
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
119
|
1
|
|
|
|
|
2
|
my $val = shift; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
1
|
|
|
|
|
6
|
return $self->{uptimeMilliseconds}; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 hostMemoryTotal |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
The total amount of RAM available to the hostoperating system |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub hostMemoryTotal { |
132
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
133
|
1
|
|
|
|
|
3
|
my $val = shift; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
1
|
|
|
|
|
5
|
return $self->{hostMemoryTotal}; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 backupSessionCount |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
The number of computers currently sending backup datato this server |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=cut |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub backupSessionCount { |
146
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
147
|
1
|
|
|
|
|
2
|
my $val = shift; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
1
|
|
|
|
|
5
|
return $self->{backupSessionCount}; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head2 hostPort |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
The port used by clients to connect to this server |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub hostPort { |
160
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
161
|
1
|
|
|
|
|
1
|
my $val = shift; |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
1
|
|
|
|
|
6
|
return $self->{hostPort}; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 orgCount |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
The number of active (versus deactivated) orgs |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=cut |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub orgCount { |
174
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
175
|
1
|
|
|
|
|
2
|
my $val = shift; |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
1
|
|
|
|
|
5
|
return $self->{orgCount}; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 uptime |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
The human-readable amount of time this PRO Server hasbeen running |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=cut |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
sub uptime { |
188
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
189
|
1
|
|
|
|
|
3
|
my $val = shift; |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
|
192
|
1
|
|
|
|
|
6
|
return $self->{uptime}; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head2 load |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
The load average on the system in the last 1 minute,5 minutes, and 15 minutes |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub load { |
202
|
1
|
|
|
1
|
1
|
53
|
my $self = shift; |
203
|
1
|
|
|
|
|
3
|
my $val = shift; |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
|
206
|
1
|
|
|
|
|
6
|
return $self->{load}; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=head2 engineMemoryFree |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
The unused RAM inside the Java virtual machine |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=cut |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
sub engineMemoryFree { |
216
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
217
|
1
|
|
|
|
|
2
|
my $val = shift; |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
|
220
|
1
|
|
|
|
|
5
|
return $self->{engineMemoryFree}; |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=head2 diskTotal |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
The amount of disk space on the host OS boot drive |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=cut |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
sub diskTotal { |
230
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
231
|
1
|
|
|
|
|
2
|
my $val = shift; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
|
234
|
1
|
|
|
|
|
5
|
return $self->{diskTotal}; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=head2 version |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
The software version date |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=cut |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub version { |
244
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
245
|
1
|
|
|
|
|
2
|
my $val = shift; |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
|
248
|
1
|
|
|
|
|
6
|
return $self->{version}; |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=head2 currentArchiveBytes |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
The total number of bytes used by archives on thissystem |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=cut |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
sub currentArchiveBytes { |
258
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
259
|
0
|
|
|
|
|
0
|
my $val = shift; |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
|
262
|
0
|
|
|
|
|
0
|
return $self->{currentArchiveBytes}; |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=head2 hostAddresses |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
Each of the IP addresses that this server might beusing |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=cut |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
sub hostAddresses { |
272
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
273
|
0
|
|
|
|
|
0
|
my $val = shift; |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
|
276
|
0
|
|
|
|
|
0
|
return $self->{hostAddresses}; |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=head2 engineMemoryTotal |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
The total RAM available to the server (Java virtualmachine) |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=cut |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
sub engineMemoryTotal { |
286
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
287
|
1
|
|
|
|
|
3
|
my $val = shift; |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
|
290
|
1
|
|
|
|
|
5
|
return $self->{engineMemoryTotal}; |
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=head2 hostName |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
The name of this host |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=cut |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
sub hostName { |
300
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
301
|
1
|
|
|
|
|
3
|
my $val = shift; |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
|
304
|
1
|
|
|
|
|
5
|
return $self->{hostName}; |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=head2 connectedClientCount |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
The number of computers currently connected to thisserver |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=cut |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub connectedClientCount { |
314
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
315
|
1
|
|
|
|
|
2
|
my $val = shift; |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
|
318
|
1
|
|
|
|
|
5
|
return $self->{connectedClientCount}; |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head2 previousMonthArchiveBytes |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
The above total from 30 days ago |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=cut |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
sub previousMonthArchiveBytes { |
328
|
1
|
|
|
1
|
1
|
6
|
my $self = shift; |
329
|
1
|
|
|
|
|
2
|
my $val = shift; |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
|
332
|
1
|
|
|
|
|
7
|
return $self->{previousMonthArchiveBytes}; |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=head2 hostMemoryFree |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
The unused RAM available to the host operating system |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=cut |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
sub hostMemoryFree { |
342
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
343
|
1
|
|
|
|
|
2
|
my $val = shift; |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
|
346
|
1
|
|
|
|
|
5
|
return $self->{hostMemoryFree}; |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
=head2 cpuUtilization |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
The percentage of CPU currently being used |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
=cut |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
sub cpuUtilization { |
356
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
357
|
1
|
|
|
|
|
2
|
my $val = shift; |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
|
360
|
1
|
|
|
|
|
7
|
return $self->{cpuUtilization}; |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=head2 hostMemoryCached |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
The swap size for the host operating system |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=cut |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
sub hostMemoryCached { |
370
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
371
|
1
|
|
|
|
|
2
|
my $val = shift; |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
|
374
|
1
|
|
|
|
|
12
|
return $self->{hostMemoryCached}; |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=head2 diskFree |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
The disk space available on the host OS boot drive |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=cut |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
sub diskFree { |
384
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
385
|
1
|
|
|
|
|
2
|
my $val = shift; |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
|
388
|
1
|
|
|
|
|
6
|
return $self->{diskFree}; |
389
|
|
|
|
|
|
|
} |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=head1 SEE ALSO |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
http://support.crashplanpro.com/doku.php/api#server_statistics |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head1 AUTHOR |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
Arnaud (Arhuman) Assad, copyright 2011 Jaguar Network |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=head1 LICENSE |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify |
402
|
|
|
|
|
|
|
it under the same terms as perl itself. |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=cut |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
1; |