UCS/Blade/CPU.pm

filter: Statementstmt 68.7% 22 / 32 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 50.0% 1 / 2 totaltotal 68.1% 30 / 44 CC 2 SCAR 8.1
CC
2
Cov
71%
new
6.0
env_stats
2.0
__ANON__
1.3
CRAP 2.3
« UCS/Blade/PowerBudget.pm ↑ Summary
1 package Cisco::UCS::Blade::CPU;
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 Cisco::UCS::Common::EnvironmentalStats;
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 %V_MAP = (
12 arch => 'arch',
13 cores => 'cores',
14 coresEnabled => 'cores_enabled',
15 dn => 'dn',
16 id => 'id',
17 model => 'model',
18 operability => 'operability',
19 operQualifierReason => 'operational_reason',
20 operState => 'operational_state',
21 perf => 'perf',
22 power => 'power',
23 presence => 'presence',
24 revision => 'revision',
25 serial => 'serial',
26 socketDesignation => 'socket',
27 speed => 'speed',
28 stepping => 'stepping',
29 thermal => 'thermal',
30 threads => 'threads',
31 vendor => 'vendor',
32 visibility => 'visibility',
33 voltage => 'voltage',
34 );
35  
36 2 ▶{ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 2 ▶ while ( my ($attribute, $pseudo) = each %V_MAP ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Cisco::UCS::Blade::CPU::V_MAP) 44 2 46
39 44 ▶ *{ __PACKAGE__ .'::'. $pseudo } = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
40 0 my $self = shift;
41 0 return $self->{$attribute}
42 }
43 44 }
44 }
45  
46 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
47 0 my ( $class, $ucs, $args ) = @_;
48  
49 0 my $self = bless {}, $class;
50 0 weaken( $self->{ucs} = $ucs );
51
52 0 foreach my $var ( keys %$args ) {
53 0 $self->{ $var } = $args->{ $var };
54 }
55  
56 0 return $self
57 }
58  
59 0 ▶sub env_stats {
Subroutine env_stats: not called CC=1 SCAR=6.9
Pod documented
60 0 my $self = shift;
61 return Cisco::UCS::Common::EnvironmentalStats->new(
62 $self->{ucs}->resolve_dn(
63 dn => "$self->{dn}/env-stats"
64 )->{outConfig}->{processorEnvStats} )
65 0 }
66  
67 2 1;
68  
69 __END__
« UCS/Blade/PowerBudget.pm ↑ Summary