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>
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;
}