Class 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 Detail

      • 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 Detail

      • 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