org.eclipse.jetty.util.statistic
Class CounterStatistic

java.lang.Object
  extended by 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
protected  AtomicLong _curr
           
protected  AtomicLong _max
           
protected  AtomicLong _total
           
 
Constructor Summary
CounterStatistic()
           
 
Method Summary
 void add(long delta)
           
 void decrement()
           
 long getCurrent()
           
 long getMax()
           
 long getTotal()
           
 void increment()
           
 void reset()
           
 void reset(long value)
           
 void subtract(long delta)
           
protected  void upxdateMax(long value)
           
 
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

upxdateMax

protected void upxdateMax(long value)


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