line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::Common::EnvironmentalStats; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
144
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our %V_MAP = ( |
11
|
|
|
|
|
|
|
inputCurrent => 'input_current', |
12
|
|
|
|
|
|
|
inputCurrentAvg => 'input_current_avg', |
13
|
|
|
|
|
|
|
inputCurrentMin => 'input_current_min', |
14
|
|
|
|
|
|
|
inputCurrentMax => 'input_current_max', |
15
|
|
|
|
|
|
|
#intervals => 'intervals', |
16
|
|
|
|
|
|
|
temperature => 'temperature', |
17
|
|
|
|
|
|
|
temperatureAvg => 'temperature_avg', |
18
|
|
|
|
|
|
|
temperatureMin => 'temperature_min', |
19
|
|
|
|
|
|
|
temperatureMax => 'temperature_max', |
20
|
|
|
|
|
|
|
thresholded => 'thresholded', |
21
|
|
|
|
|
|
|
suspect => 'suspect', |
22
|
|
|
|
|
|
|
timeCollected => 'time_collected', |
23
|
|
|
|
|
|
|
#update => 'update' |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
7
|
{ no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
219
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
while ( my ($attribute, $pseudo) = each %V_MAP ) { |
29
|
|
|
|
|
|
|
*{ __PACKAGE__ .'::'. $pseudo } = sub { |
30
|
0
|
|
|
0
|
|
|
my $self = shift; |
31
|
0
|
|
|
|
|
|
return $self->{$attribute} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
0
|
|
|
0
|
0
|
|
my ( $class, $args ) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
foreach my $var ( keys %$args ) { |
42
|
0
|
|
|
|
|
|
$self->{ $var } = $args->{ $var }; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $self |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |