Interface FunctionCounter

All Superinterfaces:
Meter
All Known Implementing Classes:
CompositeFunctionCounter, CumulativeFunctionCounter, DropwizardFunctionCounter, NoopFunctionCounter, StepFunctionCounter

public interface FunctionCounter
extends Meter
A counter that tracks a monotonically increasing function.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Interface Description
    static class  FunctionCounter.Builder<T>
    Fluent builder for function counters.

    Nested classes/interfaces inherited from interface io.micrometer.core.instrument.Meter

    Meter.Id, Meter.Type
  • Method Summary

    Modifier and Type Method Description
    static <T> FunctionCounter.Builder<T> builder​(java.lang.String name, T obj, java.util.function.ToDoubleFunction<T> f)  
    double count()  
    default java.lang.Iterable<Measurement> measure()
    Get a set of measurements.

    Methods inherited from interface io.micrometer.core.instrument.Meter

    close, getId, match, use
  • Method Details

    • builder

      static <T> FunctionCounter.Builder<T> builder​(java.lang.String name, @Nullable T obj, java.util.function.ToDoubleFunction<T> f)
    • count

      double count()
      Returns:
      The cumulative count since this counter was created.
    • measure

      default java.lang.Iterable<Measurement> measure()
      Description copied from interface: Meter
      Get a set of measurements. Should always return the same number of measurements and in the same order, regardless of the level of activity or the lack thereof.
      Specified by:
      measure in interface Meter
      Returns:
      The set of measurements that represents the instantaneous value of this meter.