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::Config::PingER



Annotate this POD

View/Report Bugs
Module Version: 0.09   Source  


perfSONAR_PS::Services::MP::Config::PingER - Configuration module for the support of scheduled tests for PingER


This class inherits perfSONAR_PS::MP::Config::Schedule in order to provide an interface to the test periods and offsets defined for PingER tests.

In this implementation, we only handle the topology-like PingER schema.


  # create the configuration object
  my $schedule = perfSONAR_PS::Services::MP::Config::PingER->new();

  # set the configuration file to use (note that the definitions of how to
  # parse for the appropriate test periods, and offset times etc for the 
  #individual tests should be defined in an inherited class.
  $schedule->configFile( 'some-config-file-path' ); 
  if ( $schedule->load() == 0 ) {

        # get a list of the test id's to run
        my @testids = $schedule->getAllTestIds();
        # determine the period of time from now until the next test should run
        my $time = $schedule->getTestTimeFromNow( $testids[0] );

    print "The next test for '$testid' will run in $time seconds from now.";

  } else {

        print "Something went wrong with parsing file '" . $schedule->configFile() . "'\n";
    return -1;



constructor for object


accessor/mutator method for the configuration file


accessor/mutator method for the configuration


Returns a list of all the testids that have been parsed.

load( $file )

Loads and parses the configuration file with schedule information '$file'. If no argument is passed, then will use the file defined in accessor/mutator $self->configFile().

Returns 0 = everything parsed okay -1 = parsing and or loading failed.

getTestById( $testid )

Returns the test information for $testid. Datastructure is a hash of the following format

$hash->{$testid}->{packetSize} = n (bytes) $hash->{$testid}->{count} = n (packets) $hash->{$testid}->{ttl} = n (hops) $hash->{$testid}->{interval} = n (secs) $hash->{$testid}->{offset} = n (secs) $hash->{$testid}->{measurementPeriod} = n (secs) $hash->{$testid}->{measurementOffset} = n (secs)

getTextNextTimeFromNow( $testid )

Determines the amonut of time from now until the next test for $testid should start.

Returns n = seconds til next test undef = testid does not exist

syntax highlighting: