Aaron Brown > perfSONAR_PS-Services-PingER-0.09 > perfSONAR_PS::Services::MP::PingER

Download:
perfSONAR_PS-Services-PingER-0.09.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.09   Source  

NAME ^

perfSONAR_PS::Services::MP::PingER - A module that performs the tasks of an MP designed for the ping measurement under the framework of the PingER project

DESCRIPTION ^

The purpose of this module is to create objects that contain all necessary information to make ping measurements to various hosts. It supports a scheduler to perform the pings as defined in the store.xml file (which is locally stored under $self->{'STORE'}).

Internally, two helper packages are part of this module: an Agent class, which performs the tests, a Scheduler class which organises the tests to be run, and a Config class which parses the STORE file.

SYNOPSIS ^

    use perfSONAR_PS::Services::MP::PingER;

    my %conf = ();
    
    # definition of where the list of hosts and parameters to ping are located
    $conf{"METADATA_DB_TYPE"} = "file";
    $conf{"METADATA_DB_NAME"} = "";
    $conf{"METADATA_DB_FILE"} = "pinger-configuraiton.xml";

    # create a new instance of the MP
    my $mp = new perfSONAR_PS::MP::PingER( \%conf );
    
    # or:
    #
    # $mp = new perfSONAR_PS::MP::PingER;
    # $mp->setConf(\%conf);

        # initiate the mp
    $mp->init();

API ^

new( $conf )

create a new MP instance from hash array $conf.

init( )

Set up the MP and configure the relevant handlers to use in order to enable on-demand measurements.

database

accessor/mutator for database instance

configureConf

setup defaults and or new values for the modules configuration variables

getConf

returns the defined key on from teh configuration

ls

accessor/mutator for the lookup service

needLS

Do we want to register with the LS?

registerLS

Actually register with the LS information about the pinger mp service. in this case we only register the existance of the MP with teh LS.

parseMetadata()

Parses the configuration files to ready the schedule for tests

prepareMetadata()

Prepares the schedule from the parsed metadata

run

Starts the MP server to run forever the tests defined through init().

Iterating through the list of scheduled tests, it will create the relevant agents (which can be overridden with teh getAgent() method locally) to perform the tests defined by their testid.

Each test will be forked off upto a maximum of $self->maxChildren() forks, and tests behind schedule will be delayed.

Once an $agent has completed its collectMeasurements() call, the forked process will call $self->storeData() in order to store the output of the $agent into a MA or similar.

setupDatabase

storeData( $agent, $testid )

Does the relevant storage of data collected from the $agent for the test id $testid. For PingER, we only care for storge into the SQL backend provided by the $agent itself.

Returns 0 = everything okay -1 = somethign went wrong

getAgent( $test )

Creates and returns a PingER Agent to run the given $test; must set the relevant data structures so that calling $agent->collectMeasurements() will actually run the test provided.

$test is expected to be a hash of key/values for the ping test

handleMessageBegin

Do something with the message.

handleMessageEnd

Do something with the message.

handleEvent

deal with on-demand measurements through here

SEE ALSO ^

perfSONAR_PS::Services::MP::Base, perfSONAR_PS::Services::MP::Scheduler, perfSONAR_PS::Services::Common, perfSONAR_PS::Services::MP::Agent::PingER, perfSONAR_PS::DB::PingER

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

  https://mail.internet2.edu/wws/info/i2-perfsonar

The perfSONAR-PS subversion repository is located at:

  https://svn.internet2.edu/svn/perfSONAR-PS 

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

VERSION ^

$Id: PingER.pm 242 2007-06-19 21:22:24Z zurawski $

AUTHOR ^

Yee-Ting Li, <ytl@slac.stanford.edu>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Internet2

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: