com.netflix.servo.monitor
Class StepCounter
java.lang.Object
com.netflix.servo.monitor.AbstractMonitor<java.lang.Number>
com.netflix.servo.monitor.StepCounter
- All Implemented Interfaces:
- Counter, Monitor<java.lang.Number>, NumericMonitor<java.lang.Number>
public final class StepCounter
- extends AbstractMonitor<java.lang.Number>
- implements Counter
A simple counter implementation backed by a StepLong. The value returned is a rate for the
previous interval as defined by the step.
|
Method Summary |
long |
getCount()
|
java.lang.Number |
getValue()
Returns the current value for the monitor. |
void |
increment()
Update the count by one. |
void |
increment(long amount)
Update the count by the specified amount. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StepCounter
public StepCounter(MonitorConfig config,
long step)
- Creates a new instance of the counter.
increment
public void increment()
- Update the count by one.
- Specified by:
increment in interface Counter
increment
public void increment(long amount)
- Update the count by the specified amount.
- Specified by:
increment in interface Counter
getValue
public java.lang.Number getValue()
- Returns the current value for the monitor.
- Specified by:
getValue in interface Monitor<java.lang.Number>
getCount
public long getCount()
toString
public java.lang.String toString()
-
- Overrides:
toString in class java.lang.Object