T
- Instance to be wrapped in the gauge for metering.public class Gauge<T> extends java.lang.Object implements Metric
Metric
that wraps some instance of T in a thread-safe
reference and allows it to be set or retrieved. Gauges record specific values over time.
For example, the current length of a queue or the size of a buffer.Modifier and Type | Method and Description |
---|---|
boolean |
compareAndSet(T expected,
T n) |
java.lang.String |
getName() |
T |
getValue() |
T |
set(T n) |
java.lang.String |
toString() |
void |
visit(MetricsVisitor visitor) |
public Gauge(java.lang.String name, T value)
public T getValue()
public java.lang.String getName()
public void visit(MetricsVisitor visitor)
public java.lang.String toString()
toString
in class java.lang.Object