org.apache.commons.monitoring
Interface Counter
- All Superinterfaces:
- StatValue
- All Known Implementing Classes:
- CompositeCounter, ThreadSafeCounter
public interface Counter
- extends StatValue
A counter to collect application processed items (bytes received, lines processed by a batch,
time elapsed by some processing ...).
- Author:
- Nicolas De Loof
|
Method Summary |
void |
add(long delta,
Unit unit)
Add value to the counter. |
int |
getHits()
|
long |
getSum()
|
| Methods inherited from interface org.apache.commons.monitoring.StatValue |
addListener, get, getMax, getMean, getMin, getMonitor, getRole, getStandardDeviation, getUnit, removeListener, reset, set, setMonitor |
add
void add(long delta,
Unit unit)
- Add value to the counter. Delta should not be negative (in such case a Gauge should be used).
- Parameters:
delta -
getSum
long getSum()
- Returns:
- the sum of all set operations
getHits
int getHits()
- Returns:
- how many time the value has been set
Copyright © 2008 The Apache Software Foundation. All Rights Reserved.