Class CounterStatistic


  • public class CounterStatistic
    extends java.lang.Object
    Statistics on a counter value.

    Keep total, current and maximum values of a counter that can be incremented and decremented. The total refers only to increments.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.atomic.AtomicLong current  
      protected java.util.concurrent.atomic.LongAccumulator max  
      protected java.util.concurrent.atomic.LongAdder total  
    • Field Detail

      • max

        protected final java.util.concurrent.atomic.LongAccumulator max
      • current

        protected final java.util.concurrent.atomic.AtomicLong current
      • total

        protected final java.util.concurrent.atomic.LongAdder total
    • Constructor Detail

      • CounterStatistic

        public CounterStatistic()
    • Method Detail

      • reset

        public void reset()
      • reset

        public void reset​(long value)
      • add

        public long add​(long delta)
      • increment

        public long increment()
      • decrement

        public long decrement()
      • getMax

        public long getMax()
      • getCurrent

        public long getCurrent()
      • getTotal

        public long getTotal()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object