line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::Interconnect::Stats; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
7
|
1
|
|
|
1
|
|
4
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
102
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our %ATTRIBUTES = ( |
12
|
|
|
|
|
|
|
load => 'load', |
13
|
|
|
|
|
|
|
load_avg => 'loadAvg', |
14
|
|
|
|
|
|
|
load_min => 'loadMin', |
15
|
|
|
|
|
|
|
load_max => 'loadMax', |
16
|
|
|
|
|
|
|
mem_available => 'memAvailable', |
17
|
|
|
|
|
|
|
mem_available_avg => 'memAvailableAvg', |
18
|
|
|
|
|
|
|
mem_available_min => 'memAvailableMin', |
19
|
|
|
|
|
|
|
mem_available_max => 'memAvailableMax', |
20
|
|
|
|
|
|
|
mem_cached => 'memCached', |
21
|
|
|
|
|
|
|
mem_cached_avg => 'memCachedAvg', |
22
|
|
|
|
|
|
|
mem_cached_min => 'memCachedMin', |
23
|
|
|
|
|
|
|
mem_cached_max => 'memCachedMax', |
24
|
|
|
|
|
|
|
suspect => 'oobIfIp', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
|
5
|
{ no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
181
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
while ( my ( $attribute, $pseudo ) = each %ATTRIBUTES ) { |
30
|
|
|
|
|
|
|
*{ __PACKAGE__ .'::'. $attribute } = sub { |
31
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
32
|
0
|
|
|
|
|
|
return $self->{$pseudo} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new { |
38
|
0
|
|
|
0
|
0
|
|
my ( $class, $args ) = @_; |
39
|
0
|
|
|
|
|
|
my $self = {}; |
40
|
0
|
|
|
|
|
|
bless $self, $class; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
while ( my( $k, $v ) = |
43
|
0
|
|
|
|
|
|
each %{ $args->{outConfig}->{swSystemStats} } ) { |
44
|
0
|
|
|
|
|
|
$self->{$k} = $v |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |