View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Aaron Brown > perfSONAR_PS-Services-PingER-0.09 > perfSONAR_PS::Services::MP::Agent::Ping



Annotate this POD

View/Report Bugs
Module Version: 0.09   Source  


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( );
  # 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


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

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.


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

syntax highlighting: