public class CounterStatistic extends Object
Keep total, current and maximum values of a counter that can be incremented and decremented. The total refers only to increments.
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
_curr |
protected AtomicLong |
_max |
protected AtomicLong |
_total |
Constructor and Description |
---|
CounterStatistic() |
protected final AtomicLong _max
protected final AtomicLong _curr
protected final AtomicLong _total
public void reset()
public void reset(long value)
public void add(long delta)
delta
- the amount to add to the countpublic void subtract(long delta)
delta
- the amount to subtract the count by.public void increment()
public void decrement()
public long getMax()
public long getCurrent()
public long getTotal()
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.