From: Kefu Chai Date: Thu, 17 May 2018 16:36:41 +0000 (+0800) Subject: mgr: fix typo in variable name and cleanups X-Git-Tag: v14.0.0~59^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=705e4566eebcb26530f5b7a5d2f1920719b50d14;p=ceph.git mgr: fix typo in variable name and cleanups * s/sercive/service/ * also fix the logging message. before this change, we have send_report send_report osd,2.0x557ea1c16550 sent me an unknown health metric: after this change, send_report send_report osd.2 sent me an unknown health metric: 0x01 Signed-off-by: Kefu Chai --- diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index bacb485a21094..156c431cd1675 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1826,26 +1826,26 @@ void DaemonServer::send_report() }); map> accumulated; - for (auto sercive : {"osd", "mon"} ) { - auto daemons = daemon_state.get_by_service(sercive); - for (const auto& daemon : daemons) { - Mutex::Locker l(daemon.second->lock); - for (const auto& metric : daemon.second->daemon_health_metrics) { + for (auto service : {"osd", "mon"} ) { + auto daemons = daemon_state.get_by_service(service); + for (const auto& [key,state] : daemons) { + Mutex::Locker l{state->lock}; + for (const auto& metric : state->daemon_health_metrics) { auto acc = accumulated.find(metric.get_type()); if (acc == accumulated.end()) { auto collector = DaemonHealthMetricCollector::create(metric.get_type()); if (!collector) { - derr << __func__ << " " << daemon.first << "." << daemon.second - << " sent me an unknown health metric: " - << static_cast(metric.get_type()) << dendl; + derr << __func__ << " " << key.first << "." << key.second + << " sent me an unknown health metric: " + << hex << static_cast(metric.get_type()) << dendl; continue; } - dout(20) << " + " << daemon.second->key << " " + dout(20) << " + " << state->key << " " << metric << dendl; tie(acc, std::ignore) = accumulated.emplace(metric.get_type(), std::move(collector)); } - acc->second->update(daemon.first, metric); + acc->second->update(key, metric); } } }