Class DerivativeGauge<F,T>

java.lang.Object
io.dropwizard.metrics5.DerivativeGauge<F,T>
Type Parameters:
F - the base gauge's value type
T - the derivative type
All Implemented Interfaces:
Gauge<T>, Metric

public abstract class DerivativeGauge<F,T> extends Object implements Gauge<T>
A gauge whose value is derived from the value of another gauge.
  • Constructor Details

    • DerivativeGauge

      protected DerivativeGauge(Gauge<F> base)
      Creates a new derivative with the given base gauge.
      Parameters:
      base - the gauge from which to derive this gauge's value
  • Method Details

    • getValue

      public T getValue()
      Description copied from interface: Gauge
      Returns the metric's current value.
      Specified by:
      getValue in interface Gauge<F>
      Returns:
      the metric's current value
    • transform

      protected abstract T transform(F value)
      Transforms the value of the base gauge to the value of this gauge.
      Parameters:
      value - the value of the base gauge
      Returns:
      this gauge's value