org.eclipse.jetty.util.statistic

## Class CounterStatistic

- java.lang.Object
- - org.eclipse.jetty.util.statistic.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 and Description
    --- | ---
    `protected java.util.concurrent.atomic.AtomicLong` | `_curr`
    `protected java.util.concurrent.atomic.AtomicLong` | `_max`
    `protected java.util.concurrent.atomic.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 java.util.concurrent.atomic.AtomicLong _max

    - #### _curr

          protected final java.util.concurrent.atomic.AtomicLong _curr

    - #### _total

          protected final java.util.concurrent.atomic.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 © 2013 FuseSource, Corp.. All Rights Reserved.