voldemort.store.stats
Class SimpleCounter

java.lang.Object
  extended by voldemort.store.stats.SimpleCounter

public class SimpleCounter
extends java.lang.Object

A simple concurrent, non-blocking event counter that resets itself every interval, and provides eventRate and average event value metrics over the last interval


Constructor Summary
SimpleCounter(long resetIntervalMs)
           
 
Method Summary
 void count()
           
 void count(long eventValue)
           
 java.lang.Double getAvgEventValue()
          Returns the average event value in the current interval
 java.lang.Double getEventRate()
          Returns the events per second in the current interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCounter

public SimpleCounter(long resetIntervalMs)
Method Detail

count

public void count()

count

public void count(long eventValue)

getEventRate

public java.lang.Double getEventRate()
Returns the events per second in the current interval

Returns:
events per second in the current interval

getAvgEventValue

public java.lang.Double getAvgEventValue()
Returns the average event value in the current interval



Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu