com.yammer.metrics.core.Gauge Maven / Gradle / Ivy
package com.yammer.metrics.core;
/**
* 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 value() {
* return queue.size();
* }
* };
*
*
* @param the type of the metric's value
*/
public abstract class Gauge implements Metric {
/**
* Returns the metric's current value.
*
* @return the metric's current value
*/
public abstract T value();
@Override
public void processWith(MetricProcessor processor, MetricName name, U context) throws Exception {
processor.processGauge(name, this, context);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy