Luke Poskitt > IBM-StorageSystem-0.045 > IBM::StorageSystem::Statistic

Download:
IBM-StorageSystem-0.045.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

IBM::StorageSystem::Statistic - Class for operations with IBM StorageSystem system statistics

VERSION ^

Version 0.01

SYNOPSIS ^

IBM::StorageSystem::Statistic - Class for operations with IBM StorageSystem system statistics

        use IBM::StorageSystem;
        
        my $ibm = IBM::StorageSystem->new(      user            => 'admin',
                                        host            => 'my-v7000',
                                        key_path        => '/path/to/my/.ssh/private_key'
                                ) or die "Couldn't create object! $!\n";
        
        # Print the current system FC IOPS
        print $ibm->fc_io->current;

        # Print the peak system FC IOPS
        print $ibm->fc_io->peak;

        # Refresh the FC IOPS statistics and print the new current value
        $ibm->fc_io->refresh;
        print $ibm->fc_io->current;

        # Or, alternately
        print $ibm->fc_io->refresh->current;

        # Retrieve the historical statistics for CPU usage and print
        # them along with the recorded epoch time
        foreach my $v ( $ibm->fc_io->history ) { print "$v->{time} : $v->{value}\n" }

        # e.g.
        # 130110140921 : 100
        # 130110140916 : 100
        # 130110140911 : 92
        # 130110140906 : 90
        # 130110140901 : 100
        # 130110140856 : 100
        # 130110140851 : 92
        # ... etc.

METHODS ^

name

Returns the statistic name - this is the same name as the method invocant.

epoch

Returns the epoch value for the samle period in which the statistic was measured.

current

Returns the current statistic value. Please refer to the lssystemstat manual page for detailed information on possible return values.

peak

Returns the peak statistic value for the current measurement time period.

peak_time

Returns the time at which the peak statistic value for the current measurement period was recorded.

Please see the NOTES section below regarding the time format used and conversion methods.

peak_epoch

Returns the epoch time at which the peak statistic value for the current measurement period was recorded.

refresh

Refreshes the statistic values.

history

Returns an array of historical values for the statistics where each array member is an anonymous hash with two keys; time - the sample time at which measurement was recorded, and value - the value recorded.

Please see the NOTES section below regarding the time format used and conversion methods.

NOTES ^

The values returned by the peak_time method, and the hash value of 'time' for each member in the array returned by the history method are 'epoch' values returned by the CLI, however these are not true epoch values in a Unix sense.

Because of this, it is not possible to pass these values to localtime for conversion without manipulation and obtain correct dates. The easiest way in which to correct the epoch times is to subtract the difference between the values of peak_time and peak_epoch from each historical epoch time. i.e.

        $t = $ibm->fc_io->peak_time - $ibm->fc_io->peak_epoch;

        # Using the example from the SYNOPSIS section above, output with Unix epoch timestamps
        foreach my $v ( $ibm->fc_io->history ) { 
                print ( $v->{time} - $t ) . ": $v->{value}\n" 

                # Or with human-readable times
                # print ~~ localtime ( $v->{time} - $t ) . ": $v->{value}\n" 
        }

AUTHOR ^

Luke Poskitt, <ltp at cpan.org>

BUGS ^

Please report any bugs or feature requests to bug-ibm-v7000-quota at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IBM-StorageSystem-Statistic. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc IBM::StorageSystem::Statistic

You can also look for information at:

ACKNOWLEDGEMENTS ^

LICENSE AND COPYRIGHT ^

Copyright 2012 Luke Poskitt.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: