Class Gauge<T>

java.lang.Object
com.gigaspaces.metrics.Metric
com.gigaspaces.metrics.Gauge<T>
Type Parameters:
T - the type of the metric's value
Direct Known Subclasses:
InternalGauge, LatencyGauge

@Deprecated public abstract class Gauge<T> extends Metric
Deprecated.
Use Micrometer's Gauge instead. Register via io.micrometer.core.instrument.Gauge.builder(...).register(meterRegistry).
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();
     }
 };
 
Since:
10.1
Author:
Niv Ingberg
  • Constructor Details

    • Gauge

      public Gauge()
      Deprecated.
  • Method Details

    • getValue

      public abstract T getValue() throws Exception
      Deprecated.
      Returns the metric's current value.
      Returns:
      the metric's current value
      Throws:
      Exception
    • calculatePercent

      protected double calculatePercent(long value, long total)
      Deprecated.
    • validate

      protected static Double validate(double value)
      Deprecated.