| 1 | package Cisco::UCS::Chassis::Stats; | ||||||||||
| 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 | inputPower => 'input_power', | ||||||||||
| 12 | inputPowerAvg => 'input_power_avg', | ||||||||||
| 13 | inputPowerMax => 'input_power_max', | ||||||||||
| 14 | inputPowerMin => 'input_power_min', | ||||||||||
| 15 | outputPower => 'output_power', | ||||||||||
| 16 | outputPowerAvg => 'output_power_avg', | ||||||||||
| 17 | outputPowerMax => 'output_power_max', | ||||||||||
| 18 | outputPowerMin => 'output_power_min', | ||||||||||
| 19 | thresholded => 'thresholded', | ||||||||||
| 20 | suspect => 'suspect', | ||||||||||
| 21 | timeCollected => 'time_collected', | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | 2 | ▶ | { no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | 2 | ▶ | while ( my ($attribute, $pseudo) = each %V_MAP ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 22 | ▶ | *{ __PACKAGE__ .'::'. $pseudo } = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||||||||||
| 28 | 0 | my $self = shift; | |||||||||
| 29 | 0 | return $self->{$attribute} | |||||||||
| 30 | } | ||||||||||
| 31 | 22 | } | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 35 | 0 | my ( $class, $args ) = @_; | |||||||||
| 36 | |||||||||||
| 37 | 0 | my $self = bless {}, $class; | |||||||||
| 38 | |||||||||||
| 39 | 0 | foreach my $var ( keys %$args ) { | |||||||||
| 40 | 0 | $self->{ $var } = $args->{ $var }; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 0 | return $self | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 2 | 1; | |||||||||
| 47 | |||||||||||
| 48 | __END__ | ||||||||||