From 095cff07beab9dc98c982a46358ef1a728900126 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 23 Jun 2026 08:13:37 +0800 Subject: [PATCH] crimson/common: use the value_map passed to dump_metric_value_map() dump_metric_value_map() takes a value_map by const reference but ignored it and iterated seastar::scollectd::get_value_map() instead. Both callers already fetch the map and pass it in, so the map was fetched twice per call and the argument was dead. Iterate vmap. The output is unchanged, since the callers pass get_value_map(), but the parameter now means what it says and the redundant fetch is gone. Signed-off-by: Kefu Chai --- src/crimson/common/metrics_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crimson/common/metrics_helpers.h b/src/crimson/common/metrics_helpers.h index bd63404c1026..199d5c79da89 100644 --- a/src/crimson/common/metrics_helpers.h +++ b/src/crimson/common/metrics_helpers.h @@ -80,7 +80,7 @@ void dump_metric_value_map( F &&filter) { assert(f); - for (const auto& [full_name, metric_family]: seastar::scollectd::get_value_map()) { + for (const auto& [full_name, metric_family]: vmap) { if (!std::invoke(filter, full_name)) { continue; } -- 2.47.3