line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::Common::PowerStats; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
179
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our %V_MAP = ( |
11
|
|
|
|
|
|
|
consumedPower => 'consumed_power', |
12
|
|
|
|
|
|
|
consumedPowerAvg=> 'consumed_power_avg', |
13
|
|
|
|
|
|
|
consumedPowerMin=> 'consumed_power_min', |
14
|
|
|
|
|
|
|
consumedPowerMax=> 'consumed_power_max', |
15
|
|
|
|
|
|
|
inputCurrent => 'input_current', |
16
|
|
|
|
|
|
|
inputCurrentAvg => 'input_current_avg', |
17
|
|
|
|
|
|
|
inputCurrentMin => 'input_current_min', |
18
|
|
|
|
|
|
|
inputCurrentMax => 'input_current_max', |
19
|
|
|
|
|
|
|
inputVoltage => 'input_voltage', |
20
|
|
|
|
|
|
|
inputVoltageAvg => 'input_voltage_avg', |
21
|
|
|
|
|
|
|
inputVoltageMin => 'input_voltage_min', |
22
|
|
|
|
|
|
|
inputVoltageMax => 'input_voltage_max', |
23
|
|
|
|
|
|
|
thresholded => 'thresholded', |
24
|
|
|
|
|
|
|
suspect => 'suspect', |
25
|
|
|
|
|
|
|
timeCollected => 'time_collected' |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
7
|
{ no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
215
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
while ( my ($attribute, $pseudo) = each %V_MAP ) { |
31
|
|
|
|
|
|
|
*{ __PACKAGE__ .'::'. $pseudo } = sub { |
32
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
33
|
0
|
|
|
|
|
|
return $self->{$attribute} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub new { |
39
|
0
|
|
|
0
|
0
|
|
my ( $class, $args ) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
foreach my $var ( keys %$args ) { |
44
|
0
|
|
|
|
|
|
$self->{ $var } = $args->{ $var }; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return $self |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |