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(long durationMs)
           
RequestCounter(long durationMs, boolean useHistogram)
           
 
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()
           
 long getDuration()
           
 long getGetAllAggregatedCount()
          Return the aggregated number of keys returned across all getAll calls, taking into account multiple values returned per call.
 long getGetAllMaxCount()
          Return the maximum number of keys returned across all getAll calls.
 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.
 long getQ95LatencyMs()
           
 long getQ99LatencyMs()
           
 float getThroughput()
           
 float getThroughputInBytes()
           
 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(long durationMs)
Parameters:
durationMs - specifies for how long you want to maintain this counter (in milliseconds).

RequestCounter

public RequestCounter(long durationMs,
                      boolean useHistogram)
Parameters:
durationMs - specifies for how long you want to maintain this counter (in milliseconds). useHistogram indicates that this counter should also use a histogram.
Method Detail

getCount

public long getCount()

getTotalCount

public long getTotalCount()

getThroughput

public float getThroughput()

getThroughputInBytes

public float getThroughputInBytes()

getDisplayThroughput

public java.lang.String getDisplayThroughput()

getAverageTimeInMs

public double getAverageTimeInMs()

getDisplayAverageTimeInMs

public java.lang.String getDisplayAverageTimeInMs()

getDuration

public long 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 aggregated number of keys returned across all getAll calls, taking into account multiple values returned per call.


getGetAllMaxCount

public long getGetAllMaxCount()
Return the maximum number of keys returned across all getAll calls.


getQ95LatencyMs

public long getQ95LatencyMs()

getQ99LatencyMs

public long getQ99LatencyMs()


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