com.netflix.servo.monitor
Class StepCounter

java.lang.Object
  extended by com.netflix.servo.monitor.AbstractMonitor<java.lang.Number>
      extended by 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.


Field Summary
 
Fields inherited from class com.netflix.servo.monitor.AbstractMonitor
config
 
Constructor Summary
StepCounter(MonitorConfig config, long step)
          Creates a new instance of the counter.
 
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 com.netflix.servo.monitor.AbstractMonitor
getConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.netflix.servo.monitor.Monitor
getConfig
 

Constructor Detail

StepCounter

public StepCounter(MonitorConfig config,
                   long step)
Creates a new instance of the counter.

Method Detail

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