Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 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();
     }
 };
 

Parameters:
<T> the type of the metric's value
public abstract class Gauge<T> implements Metric {
    
Returns the metric's current value.

Returns:
the metric's current value
    public abstract T value();
    @Override
    public <U> void processWith(MetricProcessor<U> processorMetricName name, U contextthrows Exception {
        processor.processGauge(namethiscontext);
    }
New to GrepCode? Check out our FAQ X