Package com.codahale.metrics
Interface Gauge<T>
- Type Parameters:
T
- the type of the metric's value
- All Superinterfaces:
Metric
- All Known Implementing Classes:
CachedGauge
,DerivativeGauge
,FileDescriptorRatioGauge
,JmxAttributeGauge
,RatioGauge
A gauge metric is an instantaneous reading of a particular value. To instrument a queue's depth,
for example:
final Queue<String> queue = new ConcurrentLinkedQueue<String>();
final Gauge<Integer> queueDepth = new Gauge<Integer>() {
public Integer getValue() {
return queue.size();
}
};
-
Method Summary
-
Method Details
-
getValue
T getValue()Returns the metric's current value.- Returns:
- the metric's current value
-