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
MetricMetricProcessor to process this as a metric.processWith in interface MetricU - the type of the context objectprocessor - a MetricProcessorname - the name of the current metriccontext - a given context which should be passed on to processorException - if something goes wrongCopyright © 2012. All Rights Reserved.