com.yammer.metrics.core
Class GaugeMetric<T>
java.lang.Object
com.yammer.metrics.core.GaugeMetric<T>
- Type Parameters:
T - the type of the metric's value
- All Implemented Interfaces:
- Metric
- Direct Known Subclasses:
- JmxGauge
public abstract class GaugeMetric<T>
- extends Object
- implements Metric
A gauge metric is an instantaneous reading of a particular value. To instrument a queue's depth,
for example:
Queue queue = new ConcurrentLinkedQueue();
GaugeMetric queueDepth = new GaugeMetric() {
public Integer value() {
return queue.size();
}
};
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GaugeMetric
public GaugeMetric()
value
public abstract T value()
- Returns the metric's current value.
- Returns:
- the metric's current value
processWith
public <U> void processWith(MetricsProcessor<U> processor,
MetricName name,
U context)
throws Exception
- Specified by:
processWith in interface Metric
- Throws:
Exception
Copyright © 2011. All Rights Reserved.