Component that periodically logs sample metrics.
This component can be added to any or all agents. Load as:
plugin = org.cougaar.core.examples.MetricsLoggerComponent(csv=true, delay=30000, interval=1000)
See below for more parameter options.
MTS message byte and count requires this aspect:
-Dorg.cougaar.message.transport.aspects=org.cougaar.mts.std.StatisticsAspect
CPULoad detection requires this node-agent plugin:
plugin = org.cougaar.core.thread.AgentSensorPlugin
Here's a sample log4j configuration file that logs to a file
named "metrics.csv":
log4j.rootCategory=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %-5p - %c{1} - %m%n
log4j.appender.metrics=org.apache.log4j.RollingFileAppender
log4j.appender.metrics.File=metrics.csv
log4j.appender.metrics.MaxFileSize=5024KB
log4j.appender.metrics.MaxBackupIndex=1
log4j.appender.metrics.layout=org.apache.log4j.PatternLayout
log4j.appender.metrics.layout.ConversionPattern=%m%n
log4j.additivity.org.cougaar.core.examples.MetricsLoggerComponent=false
log4j.category.org.cougaar.core.examples.MetricsLoggerComponent=DEBUG,metrics
Save the above log4j configuration in a file named:
$COUGAAR_INSTALL_PATH/configs/common/log.props
and enable with this system property:
-Dorg.cougaar.core.logging.config.filename=log.props
|