Add latency sample for getKey.

This commit is contained in:
Steve Atherton 2022-09-14 13:22:16 -07:00
parent 3df6a86d22
commit a8d3349898
1 changed files with 7 additions and 0 deletions

View File

@ -1122,6 +1122,7 @@ public:
Counter changeFeedDiskReads;
LatencySample readLatencySample;
LatencySample readKeyLatencySample;
LatencySample readValueLatencySample;
LatencySample readRangeLatencySample;
LatencySample readVersionWaitSample;
@ -1164,6 +1165,10 @@ public:
self->thisServerID,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SAMPLE_SIZE),
readKeyLatencySample("ReadKeyLatencyMetrics",
self->thisServerID,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SAMPLE_SIZE),
readValueLatencySample("ReadValueLatencyMetrics",
self->thisServerID,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
@ -5015,6 +5020,8 @@ ACTOR Future<Void> getKeyQ(StorageServer* data, GetKeyRequest req) {
double duration = g_network->timer() - req.requestTime();
data->counters.readLatencySample.addMeasurement(duration);
data->counters.readKeyLatencySample.addMeasurement(duration);
if (data->latencyBandConfig.present()) {
int maxReadBytes =
data->latencyBandConfig.get().readConfig.maxReadBytes.orDefault(std::numeric_limits<int>::max());