Interface CounterSet

  • All Known Implementing Classes:
    SimpleCounterSet

    public interface CounterSet
    A counter refers to a value which can only increase. Usually the value is reset when the process starts. A CounterSet is a set of Counter grouped by keys.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void add​(java.lang.String key, long delta)
      Increment the value by a given amount for the given key
      default void inc​(java.lang.String key)
      Increment the value by one for the given key
    • Method Detail

      • inc

        default void inc​(java.lang.String key)
        Increment the value by one for the given key

        This method is thread safe, The MetricsProvider will take care of synchronization.

        Parameters:
        key - the key to increment the count
      • add

        void add​(java.lang.String key,
                 long delta)
        Increment the value by a given amount for the given key

        This method is thread safe, The MetricsProvider will take care of synchronization.

        Parameters:
        key - the key to increment the count for the given key
        delta - amount to increment, this cannot be a negative number.