org.eclipse.jetty.util.statistic

## Class CounterStatistic

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

-     public class CounterStatistic
      extends 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 and Description
    --- | ---
    `protected AtomicLong` | `_curr`
    `protected AtomicLong` | `_max`
    `protected AtomicLong` | `_total`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CounterStatistic()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(long delta)`
    `void` | `decrement()`
    `long` | `getCurrent()`
    `long` | `getMax()`
    `long` | `getTotal()`
    `void` | `increment()`
    `void` | `reset()`
    `void` | `reset(long value)`
    `void` | `subtract(long delta)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _max

          protected final AtomicLong _max

    - #### _curr

          protected final AtomicLong _curr

    - #### _total

          protected final AtomicLong _total

  - ### Constructor Detail

    - #### CounterStatistic

          public CounterStatistic()

  - ### Method Detail

    - #### reset

          public void reset()

    - #### reset

          public void reset(long value)

    - #### add

          public void add(long delta)

      Parameters:
        `delta` - the amount to add to the count

    - #### subtract

          public void subtract(long delta)

      Parameters:
        `delta` - the amount to subtract the count by.

    - #### increment

          public void increment()

    - #### decrement

          public void decrement()

    - #### getMax

          public long getMax()

      Returns:
        max value

    - #### getCurrent

          public long getCurrent()

      Returns:
        current value

    - #### getTotal

          public long getTotal()

      Returns:
        total value

Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.