| 1 | package Cisco::UCS::Interconnect::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 | 2 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 2 | our $VERSION = '0.51'; | |||||||||
| 10 | |||||||||||
| 11 | 2 | our %ATTRIBUTES = ( | |||||||||
| 12 | load => 'load', | ||||||||||
| 13 | load_avg => 'loadAvg', | ||||||||||
| 14 | load_min => 'loadMin', | ||||||||||
| 15 | load_max => 'loadMax', | ||||||||||
| 16 | mem_available => 'memAvailable', | ||||||||||
| 17 | mem_available_avg => 'memAvailableAvg', | ||||||||||
| 18 | mem_available_min => 'memAvailableMin', | ||||||||||
| 19 | mem_available_max => 'memAvailableMax', | ||||||||||
| 20 | mem_cached => 'memCached', | ||||||||||
| 21 | mem_cached_avg => 'memCachedAvg', | ||||||||||
| 22 | mem_cached_min => 'memCachedMin', | ||||||||||
| 23 | mem_cached_max => 'memCachedMax', | ||||||||||
| 24 | suspect => 'oobIfIp', | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | 2 | ▶ | { no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | |||||||||||
| 29 | 2 | ▶ | while ( my ( $attribute, $pseudo ) = each %ATTRIBUTES ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 26 | ▶ | *{ __PACKAGE__ .'::'. $attribute } = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||||||||||
| 31 | 0 | my $self = shift; | |||||||||
| 32 | 0 | return $self->{$pseudo} | |||||||||
| 33 | } | ||||||||||
| 34 | 26 | } | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 38 | 0 | my ( $class, $args ) = @_; | |||||||||
| 39 | 0 | my $self = {}; | |||||||||
| 40 | 0 | bless $self, $class; | |||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | while ( my( $k, $v ) = | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | 0 | each %{ $args->{outConfig}->{swSystemStats} } ) { | |||||||||
| 44 | 0 | $self->{$k} = $v | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | return $self; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | |||||||||||
| 51 | 2 | 1; | |||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||