Interface ReadResponseStatsRecorder
- All Known Implementing Classes:
AbstractReadResponseStats
,ComputeResponseStats
,ComputeResponseStatsWithSizeProfiling
,MultiGetResponseStatsWithSizeProfiling
,MultiKeyResponseStats
,SingleGetResponseStats
public interface ReadResponseStatsRecorder
This class is used to record stats associated with a read response. This container may hold two types of stats:
Some stats are "mergeable", which means that we can aggregate multiple instances of
ReadResponseStatsRecorder
into one via merge(ReadResponseStatsRecorder)
, and call recordMetrics(ServerHttpRequestStats)
onto
the merged instance. Doing so achieves the same outcome as calling the recordMetrics(ServerHttpRequestStats)
API on all individual instances, but from a performance standpoint, it may be preferable to do fewer calls to the
stats object, since it needs to correctly handle high concurrency.
Some other stats are not mergeable, and must be recorded individually. Those stats are not going to be merged when
calling merge(ReadResponseStatsRecorder)
, and the code path which makes use of the merge is responsible for
calling the recordUnmergedMetrics(ServerHttpRequestStats)
API on the remaining objects.-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 themerge(ReadResponseStatsRecorder)
function.
-
Method Details
-
recordMetrics
Record all metrics, including those which can and cannot be merged.- Parameters:
stats
- theServerHttpRequestStats
object to record stats into.
-
recordUnmergedMetrics
Record metrics which are not mergeable by themerge(ReadResponseStatsRecorder)
function.- Parameters:
stats
- theServerHttpRequestStats
object to record stats into.
-
merge
Merge the stats contained in this instance with those contained in the instance.- Parameters:
other
- instance to merge with.
-