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::Schedule



Annotate this POD

View/Report Bugs
Module Version: 0.09   Source  


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


The purpose of this module separate implementation of parsing configuration files for MPs so that they provide a consistent interface to allow the perfSONAR_PS::Services::MP::Scheduler class to determine the appropriate periodicity and offset times for running measurements by an MP.


  # create the configuration object
  my $schedule = perfSONAR_PS::Services::MP::Config::Schedule->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
        # this will automatically determine the periodicity and conduct
        # a random on the offset to calculate the appropriate time.
        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;



This module exposes the following methods.


instantiate a new config object


accessor/mutator method for the configuration file


accessor/mutator method for the configuration

load( $file )

Load and parse the config file $file. Should be overridden by inheriting class.

Returns 0 = everythign okay -1 = something failed

store( $file )

Load and parse the config file $file. Should be overridden by inheriting class.

Returns 0 = everythign okay -1 = something failed


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

getTestById( $testid )

Returns the test info hash of the test with id $testid (key of hash). The returned hash should be in a key/value format suitable for the configuration tool to use.

getTestPeriodById( $testid )

Returns the test period defined for test id '$testid'.

getTestOffsetById( $testid )

Returns the test offset defined for test id '$testid'.

getTestOffsetTypeById( $testid )

Returns the test offset type defined for test id '$testid'.

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


perfSONAR_PS::Services::MP::Scheduler, perfSONAR_PS::Services::Config::PingER, perfSONAR_PS::Services::MP::Agent::Base,

To join the 'perfSONAR-PS' mailing list, please visit:

The perfSONAR-PS subversion repository is located at: 

Questions and comments can be directed to the author, or the mailing list.


$Id: 524 2007-09-05 17:35:50Z aaron $


Yee-Ting Li,


You should have received a copy of the Internet2 Intellectual Property Framework along with this software. If not, see <>


Copyright (c) 2004-2007, Internet2 and the University of Delaware

All rights reserved.

syntax highlighting: