Interface FunctionalCounter

All Superinterfaces:
Meter, Wrapper

public interface FunctionalCounter extends Meter
A read-only counter which wraps some other object that provides the counter value via a function.
  • Method Details

    • builder

      static <T> FunctionalCounter.Builder<?> builder(String name, T stateObject, Function<T,Long> fn)
      Returns a builder for registering or locating a functional counter.
      Type Parameters:
      T - type of the state object
      name - functional counter name
      stateObject - object which provides the counter value on demand
      fn - function which, when applied to the state object, returns the counter value
      new builder
    • count

      long count()
      Returns the counter value.
      counter value