|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaos.metrics.MetricManager
public class MetricManager
This class is a singleton that provides tracking and logging of metrics related to the listener. The metrics are tracked by this class and logged at intervals defined in the properties file. The available metrics are defined in the properties file.
com.telemics.listener.Listener
Method Summary | |
---|---|
void |
add(java.lang.String pMetricId,
java.util.Date pMetricValue)
Adds to a metrics value, accounting for the type of metric. |
void |
add(java.lang.String pMetricId,
java.util.GregorianCalendar pMetricValue)
Adds to a metrics value, accounting for the type of metric. |
void |
add(java.lang.String pMetricId,
int pMetricValue)
Adds to a metrics value, accounting for the type of metric. |
void |
add(java.lang.String pMetricId,
long pMetricValue)
Adds to a metrics value, accounting for the type of metric. |
float |
getAverage(java.lang.String pMetricId)
Returns the specified metric's average value. |
long |
getDataPointCount(java.lang.String pMetricId)
Returns the specified metric's count of data points. |
static MetricManager |
getInstance()
Returns the single instance, creating one if it's the first time this method is called. |
java.util.GregorianCalendar |
getTimeStamp(java.lang.String pMetricId)
Returns the specified metric's TimeStamp value. |
long |
getValue(java.lang.String pMetricId)
Returns the specified metric's value. |
void |
logMetrics()
Logs all the metrics to the file. |
void |
reset()
Resets all metrics to zero or null after performing a log of the current values. |
void |
reset(java.lang.String pMetricId)
Resets a metric to zero or null after performing a log of the metric. |
void |
shutdown()
Allows a client to explicity shutdown the metric manager causing all metrics to be logged, the timer thread to be stopped, and the internal reference for the singleton pattern to be cleared. |
void |
timerExpired()
Called during each expiration of the timer in order to log current metric totals. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MetricManager getInstance()
public void shutdown()
public void timerExpired()
timerExpired
in interface TimerCallBack
public void add(java.lang.String pMetricId, int pMetricValue)
pMetricId
- String id of the metric to add value to.pMetricValue
- Value to be added to this metric.public void add(java.lang.String pMetricId, long pMetricValue)
pMetricId
- String id of the metric to add value to.pMetricValue
- Value to be added to this metric.public void add(java.lang.String pMetricId, java.util.Date pMetricValue)
pMetricId
- String id of the metric to add value to.pMetricValue
- Value to be added to this metric.public void add(java.lang.String pMetricId, java.util.GregorianCalendar pMetricValue)
pMetricId
- String id of the metric to add value to.pMetricValue
- Value to be added to this metric.public long getValue(java.lang.String pMetricId)
pMetricId
- String id of the metric to add value to.
public float getAverage(java.lang.String pMetricId)
pMetricId
- String id of the metric to retrieve.
public java.util.GregorianCalendar getTimeStamp(java.lang.String pMetricId)
pMetricId
- String id of the metric to retrieve.
public long getDataPointCount(java.lang.String pMetricId)
pMetricId
- String id of the metric to retrieve.
public void logMetrics()
public void reset()
public void reset(java.lang.String pMetricId)
@pMetricId
- Metric id to reset
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |