From a8d334989856a0fab993e54ec4ac8bc87e8c51da Mon Sep 17 00:00:00 2001 From: Steve Atherton Date: Wed, 14 Sep 2022 13:22:16 -0700 Subject: [PATCH] Add latency sample for getKey. --- fdbserver/storageserver.actor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index 2c510d7634..5f4363d1f5 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -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 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::max());