UCS/Chassis/PSU/Stats.pm

filter: Statementstmt 75.8% 22 / 29 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 1 totaltotal 74.3% 29 / 39 CC 2 SCAR 8.6
CC
2
Cov
77%
new
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.4
« UCS/Blade/Adaptor.pm ↑ Summary UCS/Interconnect/Stats.pm »
1 package Cisco::UCS::Chassis::PSU::Stats;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 our $VERSION = '0.51';
10  
11 2 our %ATTRIBUTES = (
12 ambientTemp => 'ambient_temp',
13 ambientTempAvg => 'ambient_temp_avg',
14 ambientTempMax => 'ambient_temp_max',
15 ambientTempMin => 'ambient_temp_min',
16 id => 'id',
17 input210v => 'input_210v',
18 input210vAvg => 'input_210v_avg',
19 input210vMax => 'output_210v_max',
20 input210vMin => 'input_210v_min',
21 model => 'model',
22 operability => 'operability',
23 operational => 'operState',
24 output12v => 'output_12v',
25 output12vAvg => 'output_12v_avg',
26 output12vMin => 'output_12v_min',
27 output12vMax => 'output_12v_max',
28 output3v3 => 'output_3v3',
29 output3v3Avg => 'output_3v3_avg',
30 output3v3Max => 'output_3v3_max',
31 output3v3Min => 'output_3v3_min',
32 outputCurrent => 'output_current',
33 outputCurrentAvg=> 'output_current_avg',
34 outputCurrentMax=> 'output_current_max',
35 outputCurrentMin=> 'output_currenti_min',
36 outputPower => 'output_power',
37 outputPowerAvg => 'output_power_avg',,
38 outputPowerMin => 'output_power_min',
39 outputPowerMax => 'output_power_max',
40 performance => 'performance',
41 power => 'power',
42 presence => 'presence',
43 psuTemp1 => 'psu_temp_1',
44 psuTemp2 => 'psu_temp_2',
45 revision => 'revision',
46 serial => 'serial',
47 suspect => 'suspect',
48 thresholded => 'thresholded',
49 timeCollected => 'time_collected',
50 thermal => 'thermal',
51 vendor => 'vendor',
52 voltage => 'voltage',
53 );
54  
55 {
56 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58 2 ▶ while ( my ($attribute, $pseudo) = each %ATTRIBUTES ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Cisco::UCS::Chassis::PSU::Stats::ATTRIBUTES) 82 2 84
59 82 *{ __PACKAGE__ . '::' . $pseudo } = sub
60 0 ▶ {
Subroutine __ANON__: not called CC=1 SCAR=6.9
61 0 my $self = shift;
62 0 return $self->{$attribute}
63 }
64 82 }
65 }
66  
67  
68 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
69 0 my ( $class, $args ) = @_;
70  
71 0 my $self = bless {}, $class;
72  
73 0 foreach my $var ( keys %$args ) {
74 0 $self->{ $var } = $args->{ $var }
75 }
76
77 0 return $self;
78 }
79  
80 2 1;
81  
82 __END__
« UCS/Blade/Adaptor.pm ↑ Summary UCS/Interconnect/Stats.pm »