voldemort.store.stats
Class RequestCounter

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

public class RequestCounter
extends java.lang.Object

A thread-safe request counter that calculates throughput for a specified duration of time.


Constructor Summary
RequestCounter(int durationMS)
           
 
Method Summary
 void addRequest(long timeNS)
           
 void addRequest(long timeNS, long numEmptyResponses, long bytes, long getAllAggregatedCount)
           
 double getAverageSizeInBytes()
          Return the average size of all the versioned values returned.
 double getAverageTimeInMs()
           
 long getCount()
           
 java.lang.String getDisplayAverageTimeInMs()
           
 java.lang.String getDisplayThroughput()
           
 int getDuration()
           
 long getGetAllAggregatedCount()
          Return the aggergated number of keys returned across all getAll calls, taking into account multiple values returned per call.
 long getMaxLatencyInMs()
           
 long getMaxSizeInBytes()
          Return the size of the largest response or request in bytes returned.
 long getNumEmptyResponses()
          Return the number of requests that have returned returned no value for the requested key.
 float getThroughput()
           
 long getTotalCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestCounter

public RequestCounter(int durationMS)
Parameters:
durationMS - specifies for how long you want to maintain this counter (in milliseconds).
Method Detail

getCount

public long getCount()

getTotalCount

public long getTotalCount()

getThroughput

public float getThroughput()

getDisplayThroughput

public java.lang.String getDisplayThroughput()

getAverageTimeInMs

public double getAverageTimeInMs()

getDisplayAverageTimeInMs

public java.lang.String getDisplayAverageTimeInMs()

getDuration

public int getDuration()

getMaxLatencyInMs

public long getMaxLatencyInMs()

addRequest

public void addRequest(long timeNS)

addRequest

public void addRequest(long timeNS,
                       long numEmptyResponses,
                       long bytes,
                       long getAllAggregatedCount)
Parameters:
numEmptyResponses - For GET and GET_ALL, how many keys were no values found
bytes - Total number of bytes across all versions of values' bytes
getAllAggregatedCount - Total number of keys returned for getAll calls
See Also:
Detailed request to track additionald data about PUT, GET and GET_ALL

getNumEmptyResponses

public long getNumEmptyResponses()
Return the number of requests that have returned returned no value for the requested key. Tracked only for GET.


getMaxSizeInBytes

public long getMaxSizeInBytes()
Return the size of the largest response or request in bytes returned. Tracked only for GET, GET_ALL and PUT.


getAverageSizeInBytes

public double getAverageSizeInBytes()
Return the average size of all the versioned values returned. Tracked only for GET, GET_ALL and PUT.


getGetAllAggregatedCount

public long getGetAllAggregatedCount()
Return the aggergated number of keys returned across all getAll calls, taking into account multiple values returned per call.



Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao