Class CounterStatistic

java.lang.Object
org.eclipse.jetty.util.statistic.CounterStatistic

public class CounterStatistic extends Object

Statistics on a counter value.

This class keeps the total, current and maximum value of a counter that can be incremented and decremented. The total refers only to increments.

  • Constructor Details

    • CounterStatistic

      public CounterStatistic()
  • Method Details

    • reset

      public void reset()
      Resets the max and total to the current value.
    • reset

      public void reset(long value)
      Resets the max, total and current value to the given parameter.
      Parameters:
      value - the new current value
    • add

      public long add(long delta)
      Parameters:
      delta - the amount to add to the counter
      Returns:
      the new counter value
    • increment

      public long increment()
      Increments the value by one.
      Returns:
      the new counter value after the increment
    • decrement

      public long decrement()
      Decrements the value by one.
      Returns:
      the new counter value after the decrement
    • getMax

      public long getMax()
      Returns:
      max counter value
    • getCurrent

      public long getCurrent()
      Returns:
      current counter value
    • getTotal

      public long getTotal()
      Returns:
      total counter value
    • toString

      public String toString()
      Overrides:
      toString in class Object