]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: use the value_map passed to dump_metric_value_map() 69656/head
authorKefu Chai <k.chai@proxmox.com>
Tue, 23 Jun 2026 00:13:37 +0000 (08:13 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 24 Jun 2026 00:58:15 +0000 (08:58 +0800)
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 <k.chai@proxmox.com>
src/crimson/common/metrics_helpers.h

index bd63404c1026ce2b310d891052cdb71f31de86a7..199d5c79da896bfb68411536d310960fb69773e8 100644 (file)
@@ -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;
     }