voldemort.store.stats
Class RequestCounter
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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 completenumEmptyResponses
- For GET and GET_ALL, how many keys were no values foundvalueBytes
- Total number of bytes across all versions of values' byteskeyBytes
- Total number of bytes in the keysgetAllAggregatedCount
- 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