Class SimpleCounter

    • Constructor Detail

      • SimpleCounter

        public SimpleCounter​(String name)
    • Method Detail

      • add

        public void add​(long value)
        Description copied from interface: Counter
        Increment the value by a given amount.

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

        Specified by:
        add in interface Counter
        Overrides:
        add in class Metric
        Parameters:
        value - amount to increment, this cannot be a negative number.
      • reset

        public void reset()
        Overrides:
        reset in class Metric
      • get

        public long get()
        Description copied from interface: Counter
        Get the current value held by the counter.

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

        Specified by:
        get in interface Counter
        Returns:
        the current value