UCS/Common/EnvironmentalStats.pm

filter: Statementstmt 73.0% 19 / 26 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 71.4% 25 / 35 CC 2 SCAR 9.0
CC
2
Cov
75%
new
6.0
__ANON__
1.3
BEGIN
1.0
CRAP 2.5
« UCS/Chassis/Stats.pm ↑ Summary UCS/Common/PowerStats.pm »
1 package Cisco::UCS::Common::EnvironmentalStats;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '0.51';
9  
10 2 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 2 ▶{ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 2 ▶ while ( my ($attribute, $pseudo) = each %V_MAP ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Cisco::UCS::Common::EnvironmentalStats::V_MAP) 22 2 24
29 22 ▶ *{ __PACKAGE__ .'::'. $pseudo } = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
30 0 my $self = shift;
31 0 return $self->{$attribute}
32 }
33 22 }
34 }
35  
36 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
37 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 2 1;
49  
50 __END__
« UCS/Chassis/Stats.pm ↑ Summary UCS/Common/PowerStats.pm »