NAME
perfSONAR_PS::Services::MP::Agent::Ping - A module that will run a ping and return it's output in a suitable internal data structure.
DESCRIPTION
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
SYNOPSIS
# 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
new( $command, $options, $namespace)
Creates a new ping agent class
init()
inherited from parent classes. makes sure that the ping executable is existing.
pingPriming
accessor/mutator class to determine whether we are conducting ping priming or not
deadline
deadline is not supported in pinger
collectMeasurements( )
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.
parse()
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.
toAPI
casts the data (results()) into maxim's api to easy casting etc.
toDOM()
returns the object as a LibXML dom