com.clearspring.metriccatcher
Class MetricCatcher
java.lang.Object
java.lang.Thread
com.clearspring.metriccatcher.MetricCatcher
- All Implemented Interfaces:
- Runnable
public class MetricCatcher
- extends Thread
|
Method Summary |
protected com.yammer.metrics.core.Metric |
createMetric(JSONMetric jsonMetric)
Create a Metric object from a JSONMetric |
void |
run()
Grab metric messages off the listening socket, creating and updating
them as needed. |
void |
shutdown()
Shutdown this MetricCatcher |
protected void |
updateMetric(com.yammer.metrics.core.Metric metric,
double value)
Update various metric types. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
MetricCatcher
public MetricCatcher(DatagramSocket socket,
Map<String,com.yammer.metrics.core.Metric> metricCache)
throws IOException
- Throws:
IOException
run
public void run()
- Grab metric messages off the listening socket, creating and updating
them as needed.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
createMetric
protected com.yammer.metrics.core.Metric createMetric(JSONMetric jsonMetric)
- Create a Metric object from a JSONMetric
- Parameters:
jsonMetric - A JSONMetric to make a Metric from
- Returns:
- A Metric equivalent to the given JSONMetric
updateMetric
protected void updateMetric(com.yammer.metrics.core.Metric metric,
double value)
- Update various metric types.
Gauge:
Counter:
Increment or decrement based upon sign of value
Clear counter if given 0
Meter:
mark() the meter with the given value
Histogram:
update() the histogram with the given value
Timer:
- Parameters:
metric - The metric to updatevalue - The value to supply when updating the metric
shutdown
public void shutdown()
- Shutdown this MetricCatcher
Copyright © 2012. All Rights Reserved.