org.eclipse.jetty.util.statistic
public class CounterStatistic extends java.lang.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 java.util.concurrent.atomic.AtomicLong |
_curr |
protected java.util.concurrent.atomic.AtomicLong |
_max |
protected java.util.concurrent.atomic.AtomicLong |
_total |
Constructor and Description |
---|
CounterStatistic() |
protected final java.util.concurrent.atomic.AtomicLong _max
protected final java.util.concurrent.atomic.AtomicLong _curr
protected final java.util.concurrent.atomic.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 © 2014. All Rights Reserved.