| org.cougaar.tools.csmart.runtime.plugin.CSMARTPlugin org.cougaar.tools.csmart.runtime.plugin.MetricsInitializerPlugin
MetricsInitializerPlugin | public class MetricsInitializerPlugin extends CSMARTPlugin implements MetricsConstants(Code) | | MetricsInitializerPlugin : Launch a number of tasks and wait
for them to flow through the system, measuring the time and memory
expended. We can also open a back door to a controller process to
publish the outcome.
Startup Procedure
As organizations with MetricsProvider capability report in, we
send them an "AreYouReady" task. This task is intended to yield a
100% confidence allocation result when all the Agents have
initialized.
When 100% ready reponses have been received from a number of
MetricsProvider organizations that equals the numProviders
parameter, we send a "Start" task to them indicating that they
should begin collecting statistics.
If sampleInterval is non-zero, then after every sampleInterval seconds
have been completed a statistics sample is taken by issuing a
"Sample" control task.
The 100% completion of the sample tasks causes a "Finish" task to be
sent which gathers the final statistics.
|
Inner Class :class PluginAlarm implements Alarm | |
FINISHED | final static int FINISHED(Code) | | |
FINISHING | final static int FINISHING(Code) | | |
INITIAL | final static int INITIAL(Code) | | |
RUNNING | final static int RUNNING(Code) | | |
SAMPLING | final static int SAMPLING(Code) | | |
SAMPLING_AND_DONE | final static int SAMPLING_AND_DONE(Code) | | |
STARTING | final static int STARTING(Code) | | |
WAITING | final static int WAITING(Code) | | |
execute | public void execute()(Code) | | Execute plugin. We use a simple state machine to take us through
the steps needed. The only somewhat complicated part involves the
SAMPLING state. Periodically (every so many tasks), we can
initiate a statistics sample. The statistics sample is taken in a
fashion similar to all the other control steps: send a control
task and wait for everyone to respond.
|
setupSubscriptions | public void setupSubscriptions()(Code) | | |
|
|