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.
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicLong | |
| private final LongAccumulator | |
| private final LongAdder |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public long | |
| public long | |
| public long | |
| public long | |
| public long | |
| public void | |
| public void | reset(final long
the new current value value)Resets the max, total and current value to the given parameter. |
| public String |
| _current | back to summary |
|---|---|
| private final AtomicLong _current | |
| _max | back to summary |
|---|---|
| private final LongAccumulator _max | |
| _total | back to summary |
|---|---|
| private final LongAdder _total | |
| CounterStatistic | back to summary |
|---|---|
| public CounterStatistic() | |
| add | back to summary |
|---|---|
public long add(final long delta)
| |
| decrement | back to summary |
|---|---|
| public long decrement() Decrements the value by one.
| |
| getCurrent | back to summary |
|---|---|
| public long getCurrent() Get current counter value.
| |
| getMax | back to summary |
|---|---|
| public long getMax() Get max counter value.
| |
| getTotal | back to summary |
|---|---|
| public long getTotal() Get total counter value.
| |
| increment | back to summary |
|---|---|
| public long increment() Increments the value by one.
| |
| reset | back to summary |
|---|---|
| public void reset() Resets the max and total to the current value. | |
| reset | back to summary |
|---|---|
| public void reset(final long value) Resets the max, total and current value to the given parameter.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |