public class Counter extends java.lang.Object implements Metric
| Constructor and Description |
|---|
Counter(java.lang.String name)
Construct a new Counter given a name
|
Counter(java.lang.String name,
long value)
Construct a new Counter given a name and a initial value of the value
|
| Modifier and Type | Method and Description |
|---|---|
long |
decrement(long amount)
Decrement this counter by a given amount.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getName()
Return the name of the metric.
|
long |
getValue() |
int |
hashCode() |
long |
increment(long amount)
Increment this counter by a given amount.
|
java.lang.String |
toString() |
public Counter(java.lang.String name)
name - the name of the Counter.public Counter(java.lang.String name,
long value)
name - the name of the valuevalue - initial value.public long getValue()
public long increment(long amount)
public long decrement(long amount)
public java.lang.String getName()
Metricpublic final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object