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 Object
implements ReadResponseStats, ReadResponseStatsRecorder
This abstract class is the container for response stats. The stats can be accumulated via the APIs provided by
ReadResponseStats
, and then recorded using the API from ReadResponseStatsRecorder
.
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
protected abstract int
void
incrementCosineSimilarityCount
(int count) void
incrementCountOperatorCount
(int count) void
incrementDotProductCount
(int count) void
incrementHadamardProductCount
(int count) void
protected boolean
void
merge
(ReadResponseStatsRecorder other) Merge the stats contained in this instance with those contained in the instance.void
Record all metrics, including those which can and cannot be merged.void
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
-
Field Details
-
multiChunkLargeValueCount
protected int multiChunkLargeValueCount
-
-
Constructor Details
-
AbstractReadResponseStats
public AbstractReadResponseStats()
-
-
Method Details
-
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
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
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
Description copied from interface:ReadResponseStatsRecorder
Merge the stats contained in this instance with those contained in the 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
-