UCS/Blade/Adaptor.pm

filter: Statementstmt 65.5% 19 / 29 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 50.0% 1 / 2 totaltotal 65.0% 26 / 40 CC 2 SCAR 8.8
CC
2
Cov
68%
new
6.0
env_stats
2.0
__ANON__
1.3
CRAP 2.4
« UCS/Common/PowerStats.pm ↑ Summary UCS/Chassis/PSU/Stats.pm »
1 package Cisco::UCS::Blade::Adaptor;
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 'adminPowerState' => 'admin_pwoer_state',
12 'baseMac' => 'base_mac',
13 'bladeId' => 'blade_id',
14 'chassisId' => 'chassis_id',
15 'connPath' => 'conn_path',
16 'connStatus' => 'conn_status',
17 'dn' => 'dn',
18 'integrated' => 'integrated',
19 'managingInst' => 'managing_instance',
20 'model' => 'model',
21 'operability' => 'operability',
22 'operState' => 'oper_state',
23 'pciSlot' => 'pci_slot',
24 'partNumber' => 'part_number',
25 'pciAddr' => 'pci_addr',
26 'perf' => 'perf',
27 'power' => 'power',
28 'presence' => 'presence',
29 'reachability' => 'reachability',
30 'revision' => 'revision',
31 'serial' => 'serial',
32 'thermal' => 'thermal',
33 'voltage' => 'voltage',
34 'vendor' => 'vendor'
35 );
36  
37 2 ▶{ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 2 ▶ while ( my ($attribute, $pseudo) = each %V_MAP ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Cisco::UCS::Blade::Adaptor::V_MAP) 48 2 50
40 48 ▶ *{ __PACKAGE__ .'::'. $pseudo } = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
41 0 my $self = shift;
42 0 return $self->{$attribute}
43 }
44 48 }
45 }
46  
47 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
48 0 my ( $class, $ucs, $args ) = @_;
49  
50 0 my $self = bless {}, $class;
51 0 weaken( $self->{ucs} = $ucs );
52
53 0 foreach my $var ( keys %$args ) {
54 0 $self->{ $var } = $args->{ $var };
55 }
56  
57 0 return $self
58 }
59  
60 0 ▶sub env_stats {
Subroutine env_stats: not called CC=1 SCAR=6.9
Pod documented
61 0 my $self = shift;
62  
63 return Cisco::UCS::Common::EnvironmentalStats->new(
64 $self->{ucs}->resolve_dn(
65 dn => "$self->{dn}/env-stats"
66 )->{outConfig}->{processorEnvStats}
67 )
68 0 }
69  
70 2 1;
71  
72 __END__
« UCS/Common/PowerStats.pm ↑ Summary UCS/Chassis/PSU/Stats.pm »