StorageSystem/Statistic/Node/Network.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
_values
2.0
BEGIN
2.0
CRAP 2.0
1 package IBM::StorageSystem::Statistic::Node::Network;
2  
3 use strict;
4 use warnings;
5  
6 use Carp qw(croak);
7  
8 our @ATTR = qw(start_time end_time ethX1_bytes_received ethX1_bytes_sent ethX1_packets_received ethX1_packets_sent ethX0_bytes_received ethX0_bytes_sent ethX0_packets_received ethX0_packets_sent ethX1_drops ethX0_drops);
9  
10 foreach my $attr ( @ATTR ) {
11 {
12 no strict 'refs';
13 *{ __PACKAGE__ .'::'. $attr } = sub {
14 my( $self, $val ) = @_;
15 $self->{$attr} = $val if $val;
16 return $self->{$attr}
17 }
18 }
19 }
20  
21 sub new {
22 my( $class, @vals ) = @_;
23 my $self = bless {}, $class;
24 my $c = 0;
25  
26 foreach my $attr ( @ATTR ) { $self->{$attr} = $vals[$c]; $c++ }
27  
28 return $self
29 }
30  
31 sub _values { return @ATTR }
32  
33 1;
34  
35 __END__