perfSONAR_PS::Services::MP::Agent::Ping - A module that will run a ping and return it's output in a suitable internal data structure.
Inherited perfSONAR_PS::MP::Agent::Ping class that allows a ping to be executed. This class extends the features of the ping class to enable:
- storage of ping results into PingER databases. - ping 'priming'; where by the first ping singleton value is ignore as it it expected that it will be anomolous due to the effect of various caches along the path
# create and setup a new Agent my $agent = perfSONAR_PS::Services::MP::Agent::Ping( ); $agent->init(); # collect the results (i.e. run the command) if( $mp->collectMeasurements() == 0 ) { # get the raw datastructure for the measurement use Data::Dumper; print "Results:\n" . Dumper $self->results() . "\n"; } # opps! something went wrong! :( else { print STDERR "Command: '" . $self->commandString() . "' failed with result '" . $self->results() . "': " . $agent->error() . "\n"; }
head1 API
Creates a new ping agent class
inherited from parent classes. makes sure that the ping executable is existing.
accessor/mutator class to determine whether we are conducting ping priming or not
deadline is not supported in pinger
Runs the command with the options specified in constructor. The return of this method should be
-1 = something failed 0 = command ran okay
on success, this method should call the parse() method to determine the relevant performance output from the tool.
We do something a bit more involved with PingER as we wish to prime the network by running a single independent ping prior to the real test.
parses the output from a command line measurement of pings. we must take care to ensure that we ignore the first ping if we are doing ping priming.
casts the data (results()) into maxim's api to easy casting etc.
returns the object as a LibXML dom
To install IEPM::PingER::Statistics::RTT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IEPM::PingER::Statistics::RTT
CPAN shell
perl -MCPAN -e shell install IEPM::PingER::Statistics::RTT
For more information on module installation, please visit the detailed CPAN module installation guide.