Interface Counter

  • All Superinterfaces:
    AutoCloseable, UncheckedCloseable

    public interface Counter
    extends UncheckedCloseable
    Counter metric, which is a simple incrementing and decrementing number.

    Note that if you find you only use its increase() and never decrease() methods, then you probably want to use Meter with mark() instead of this.

    • Method Detail

      • increment

        default void increment()
      • increment

        void increment​(long howMany)
      • decrement

        default void decrement()
      • decrement

        void decrement​(long howMany)
      • get

        long get()
        Gets the total number of events. Beware that this could have overflown. This is typically used in unit tests of metrics, more than to expose the metrics in production (because exposing metrics is really the role of the infrautils metrics implementation of this API).