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
public interface Gauge<T> extends Metric
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TgetValue()Returns the metric's current value.
-
-
-
Method Detail
-
getValue
T getValue()
Returns the metric's current value.- Returns:
- the metric's current value
-
-