public final class BasicCounter extends AbstractMonitor<java.lang.Number> implements Counter
AtomicLong.
The value is the total count for the life of the counter. Observers are responsible
for converting to a rate and handling overflows if they occur.config| Constructor and Description |
|---|
BasicCounter(MonitorConfig config)
Creates a new instance of the counter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Number |
getValue(int pollerIdx)
Returns the current value for the monitor for the nth poller.
|
int |
hashCode() |
void |
increment()
Update the count by one.
|
void |
increment(long amount)
Update the count by the specified amount.
|
java.lang.String |
toString() |
getConfig, getValuepublic BasicCounter(MonitorConfig config)
public void increment()
public void increment(long amount)
public java.lang.Number getValue(int pollerIdx)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object