| 1 | package IBM::SONAS; | ||
| 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 IBM::StorageSystem; |
|
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.20'; | |
| 10 | |||
| 11 | 2 | our @METHODS = qw(health disk export filesystem interface mount node quota | |
| 12 | replication service snapshot task); | ||
| 13 | |||
| 14 | 2 | our @ATTRS = qw(cluster_throughput cluster_client_throughput | |
| 15 | cluster_create_delete_latency cluster_create_delete_operations | ||
| 16 | cluster_open_close_latency cluster_open_close_operations | ||
| 17 | cluster_read_write_operations cluster_read_write_latency); | ||
| 18 | |||
| 19 | 2 | foreach my $method ( @METHODS ) { | |
| 20 | { | ||
| 21 | 2 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | 24 | my $get_method = "get_$method"; | |
| 23 | 24 | my $get_methods = "get_${method}s"; | |
| 24 | |||
| 25 | 24 | ▶ | *{ __PACKAGE__ ."::$method" } = sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||
| 26 | 0 | my $self = shift; | |
| 27 | 0 | $self->{ss}->$method(@_) | |
| 28 | 24 | }; | |
| 29 | |||
| 30 | 24 | ▶ | *{ __PACKAGE__ ."::$get_method" } = sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||
| 31 | 0 | my $self = shift; | |
| 32 | 0 | $self->{ss}->$get_method(@_) | |
| 33 | 24 | }; | |
| 34 | |||
| 35 | 24 | ▶ | *{ __PACKAGE__ ."::$get_methods" } = sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||
| 36 | 0 | my $self = shift; | |
| 37 | 0 | $self->{ss}->$get_methods(@_) | |
| 38 | } | ||
| 39 | 24 | } | |
| 40 | } | ||
| 41 | |||
| 42 | 2 | foreach my $attr ( @ATTRS ) { | |
| 43 | { | ||
| 44 | 2 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | 16 | ▶ | *{ __PACKAGE__ ."::$attr" } = sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||
| 46 | 0 | my $self = shift; | |
| 47 | 0 | $self->{ss}->$attr(@_) | |
| 48 | } | ||
| 49 | 16 | } | |
| 50 | } | ||
| 51 | |||
| 52 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | 0 | my ( $class, %args ) = @_; | |
| 54 | |||
| 55 | 0 | my $self = bless {} , $class; | |
| 56 | 0 | $self->{ss} = IBM::StorageSystem->new( %args, no_stats => 1 ); | |
| 57 | |||
| 58 | 0 | return $self | |
| 59 | } | ||
| 60 | |||
| 61 | 2 | 1; | |
| 62 | |||
| 63 | __END__ | ||