From: Kefu Chai Date: Tue, 23 Jun 2026 00:13:37 +0000 (+0800) Subject: crimson/common: use the value_map passed to dump_metric_value_map() X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=095cff07beab9dc98c982a46358ef1a728900126;p=ceph.git 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 --- 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; }