Class AbstractReadResponseStats
- java.lang.Object
-
- com.linkedin.venice.listener.response.stats.AbstractReadResponseStats
-
- All Implemented Interfaces:
ReadResponseStats
,ReadResponseStatsRecorder
- Direct Known Subclasses:
MultiKeyResponseStats
,SingleGetResponseStats
public abstract class AbstractReadResponseStats extends java.lang.Object implements ReadResponseStats, ReadResponseStatsRecorder
This abstract class is the container for response stats. The stats can be accumulated via the APIs provided byReadResponseStats
, and then recorded using the API fromReadResponseStatsRecorder
. The class hierarchy aims to minimize the amount of state required for any given response, based on its type and relevant server configs: -AbstractReadResponseStats
+--SingleGetResponseStats
+--MultiKeyResponseStats
+--MultiGetResponseStatsWithSizeProfiling
+--ComputeResponseStats
+--ComputeResponseStatsWithSizeProfiling
-
-
Field Summary
Fields Modifier and Type Field Description protected int
multiChunkLargeValueCount
-
Constructor Summary
Constructors Constructor Description AbstractReadResponseStats()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addDatabaseLookupLatency(long startTimeInNanos)
The implementer is responsible for doing the subtraction between the current time and the start time.void
addReadComputeDeserializationLatency(double latency)
void
addReadComputeLatency(double latency)
void
addReadComputeOutputSize(int size)
void
addReadComputeSerializationLatency(double latency)
long
getCurrentTimeInNanos()
protected abstract int
getRecordCount()
void
incrementCosineSimilarityCount(int count)
void
incrementCountOperatorCount(int count)
void
incrementDotProductCount(int count)
void
incrementHadamardProductCount(int count)
void
incrementMultiChunkLargeValueCount()
protected boolean
isAssembledMultiChunkLargeValue()
void
merge(ReadResponseStatsRecorder other)
Merge the stats contained in this instance with those contained in the {@param other} instance.void
recordMetrics(ServerHttpRequestStats stats)
Record all metrics, including those which can and cannot be merged.void
recordUnmergedMetrics(ServerHttpRequestStats stats)
Record metrics which are not mergeable by theReadResponseStatsRecorder.merge(ReadResponseStatsRecorder)
function.void
setStorageExecutionQueueLen(int storageExecutionQueueLen)
void
setStorageExecutionSubmissionWaitTime(double storageExecutionSubmissionWaitTime)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.linkedin.davinci.listener.response.ReadResponseStats
addKeySize, addValueSize
-
-
-
-
Method Detail
-
getRecordCount
protected abstract int getRecordCount()
-
getCurrentTimeInNanos
public long getCurrentTimeInNanos()
- Specified by:
getCurrentTimeInNanos
in interfaceReadResponseStats
-
addDatabaseLookupLatency
public void addDatabaseLookupLatency(long startTimeInNanos)
Description copied from interface:ReadResponseStats
The implementer is responsible for doing the subtraction between the current time and the start time.- Specified by:
addDatabaseLookupLatency
in interfaceReadResponseStats
- Parameters:
startTimeInNanos
- the timestamp in nanoseconds of beginning of the period to measure.
-
setStorageExecutionSubmissionWaitTime
public void setStorageExecutionSubmissionWaitTime(double storageExecutionSubmissionWaitTime)
- Specified by:
setStorageExecutionSubmissionWaitTime
in interfaceReadResponseStats
-
setStorageExecutionQueueLen
public void setStorageExecutionQueueLen(int storageExecutionQueueLen)
- Specified by:
setStorageExecutionQueueLen
in interfaceReadResponseStats
-
incrementMultiChunkLargeValueCount
public void incrementMultiChunkLargeValueCount()
- Specified by:
incrementMultiChunkLargeValueCount
in interfaceReadResponseStats
-
recordMetrics
public void recordMetrics(ServerHttpRequestStats stats)
Description copied from interface:ReadResponseStatsRecorder
Record all metrics, including those which can and cannot be merged.- Specified by:
recordMetrics
in interfaceReadResponseStatsRecorder
- Parameters:
stats
- theServerHttpRequestStats
object to record stats into.
-
recordUnmergedMetrics
public void recordUnmergedMetrics(ServerHttpRequestStats stats)
Description copied from interface:ReadResponseStatsRecorder
Record metrics which are not mergeable by theReadResponseStatsRecorder.merge(ReadResponseStatsRecorder)
function.- Specified by:
recordUnmergedMetrics
in interfaceReadResponseStatsRecorder
- Parameters:
stats
- theServerHttpRequestStats
object to record stats into.
-
merge
public void merge(ReadResponseStatsRecorder other)
Description copied from interface:ReadResponseStatsRecorder
Merge the stats contained in this instance with those contained in the {@param other} instance.- Specified by:
merge
in interfaceReadResponseStatsRecorder
- Parameters:
other
- instance to merge with.
-
isAssembledMultiChunkLargeValue
protected boolean isAssembledMultiChunkLargeValue()
-
addReadComputeLatency
public void addReadComputeLatency(double latency)
- Specified by:
addReadComputeLatency
in interfaceReadResponseStats
-
addReadComputeDeserializationLatency
public void addReadComputeDeserializationLatency(double latency)
- Specified by:
addReadComputeDeserializationLatency
in interfaceReadResponseStats
-
addReadComputeSerializationLatency
public void addReadComputeSerializationLatency(double latency)
- Specified by:
addReadComputeSerializationLatency
in interfaceReadResponseStats
-
addReadComputeOutputSize
public void addReadComputeOutputSize(int size)
- Specified by:
addReadComputeOutputSize
in interfaceReadResponseStats
-
incrementDotProductCount
public void incrementDotProductCount(int count)
- Specified by:
incrementDotProductCount
in interfaceReadResponseStats
-
incrementCountOperatorCount
public void incrementCountOperatorCount(int count)
- Specified by:
incrementCountOperatorCount
in interfaceReadResponseStats
-
incrementCosineSimilarityCount
public void incrementCosineSimilarityCount(int count)
- Specified by:
incrementCosineSimilarityCount
in interfaceReadResponseStats
-
incrementHadamardProductCount
public void incrementHadamardProductCount(int count)
- Specified by:
incrementHadamardProductCount
in interfaceReadResponseStats
-
-