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(java.lang.String name, long durationMs)
           
RequestCounter(java.lang.String name, long durationMs, boolean useHistogram)
           
RequestCounter(java.lang.String name, long durationMs, boolean useHistogram, RequestCounter... parents)
           
RequestCounter(java.lang.String name, long durationMs, RequestCounter... parents)
           
 
Method Summary
 void addRequest(long timeNS)
           
 void addRequest(long timeNS, long numEmptyResponses, long valueBytes, long keyBytes, long getAllAggregatedCount)
          Detailed request to track additional data about PUT, GET and GET_ALL
 double getAverageKeySizeInBytes()
           
 double getAverageTimeInMs()
           
 double getAverageValueSizeInBytes()
           
 long getCount()
           
 java.lang.String getDisplayAverageTimeInMs()
           
 java.lang.String getDisplayThroughput()
           
 long getGetAllAggregatedCount()
           
 float getGetAllKeysThroughput()
           
 long getGetAllMaxCount()
           
 long getMaxKeySizeInBytes()
           
 long getMaxLatencyInMs()
           
 long getMaxValueSizeInBytes()
           
 long getNumEmptyResponses()
           
 double getQ10LatencyMs()
           
 double getQ50LatencyMs()
           
 double getQ95LatencyMs()
           
 double 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(java.lang.String name,
                      long durationMs)

RequestCounter

public RequestCounter(java.lang.String name,
                      long durationMs,
                      RequestCounter... parents)
Parameters:
durationMs - specifies for how long you want to maintain this counter (in milliseconds).

RequestCounter

public RequestCounter(java.lang.String name,
                      long durationMs,
                      boolean useHistogram)

RequestCounter

public RequestCounter(java.lang.String name,
                      long durationMs,
                      boolean useHistogram,
                      RequestCounter... parents)
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()
Returns:
The count of queries tracked by this RequestCounter during the current set of (non-expired) sample windows.

getTotalCount

public long getTotalCount()
Returns:
The total amount of queries tracked by this RequestCounter since the beginning of time.

getThroughput

public float getThroughput()
Returns:
The rate of queries per second to this RequestCounter.

getGetAllKeysThroughput

public float getGetAllKeysThroughput()
Returns:
The rate of keys per second that were queried through GetAll requests.

getThroughputInBytes

public float getThroughputInBytes()
Returns:
The rate of bytes per second for queries tracked by this RequestCounter.

getDisplayThroughput

public java.lang.String getDisplayThroughput()

getAverageTimeInMs

public double getAverageTimeInMs()

getDisplayAverageTimeInMs

public java.lang.String getDisplayAverageTimeInMs()

getMaxLatencyInMs

public long getMaxLatencyInMs()

addRequest

public void addRequest(long timeNS)
Parameters:
timeNS - time of operation, in nanoseconds

addRequest

public void addRequest(long timeNS,
                       long numEmptyResponses,
                       long valueBytes,
                       long keyBytes,
                       long getAllAggregatedCount)
Detailed request to track additional data about PUT, GET and GET_ALL

Parameters:
timeNS - The time in nanoseconds that the operation took to complete
numEmptyResponses - For GET and GET_ALL, how many keys were no values found
valueBytes - Total number of bytes across all versions of values' bytes
keyBytes - Total number of bytes in the keys
getAllAggregatedCount - Total number of keys returned for getAll calls

getNumEmptyResponses

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

getMaxValueSizeInBytes

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

getMaxKeySizeInBytes

public long getMaxKeySizeInBytes()
Returns:
the size of the largest response or request in bytes returned.

getAverageValueSizeInBytes

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

getAverageKeySizeInBytes

public double getAverageKeySizeInBytes()
Returns:
the average size of all the keys. Tracked for all operations.

getGetAllAggregatedCount

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

getGetAllMaxCount

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

getQ10LatencyMs

public double getQ10LatencyMs()

getQ50LatencyMs

public double getQ50LatencyMs()

getQ95LatencyMs

public double getQ95LatencyMs()

getQ99LatencyMs

public double getQ99LatencyMs()


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