Interface Gauge<T>

Type Parameters:
T - the type of the metric's value
All Superinterfaces:
Metric
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Gauge<T> extends Metric
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 getValue() {
         return queue.size();
     }
 };
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the metric's current value.
  • Method Details

    • getValue

      T getValue()
      Returns the metric's current value.
      Returns:
      the metric's current value