T
- the type of the metric's valuepublic abstract class Gauge<T> extends Object implements Metric
final Queue<String> queue = new ConcurrentLinkedQueue<String>();
final Gauge<Integer> queueDepth = new Gauge<Integer>() {
public Integer value() {
return queue.size();
}
};
Constructor and Description |
---|
Gauge() |
Modifier and Type | Method and Description |
---|---|
<U> void |
processWith(MetricProcessor<U> processor,
MetricName name,
U context)
Allow the given
MetricProcessor to process this as a metric. |
abstract T |
value()
Returns the metric's current value.
|
public abstract T value()
public <U> void processWith(MetricProcessor<U> processor, MetricName name, U context) throws Exception
Metric
MetricProcessor
to process this
as a metric.processWith
in interface Metric
U
- the type of the context objectprocessor
- a MetricProcessor
name
- the name of the current metriccontext
- a given context which should be passed on to processor
Exception
- if something goes wrongCopyright © 2014. All Rights Reserved.