diff options
author | Kefu Chai <kchai@redhat.com> | 2018-05-17 18:36:41 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2018-05-17 18:36:43 +0200 |
commit | 705e4566eebcb26530f5b7a5d2f1920719b50d14 (patch) | |
tree | 0a748a8c0d92073ea3fc6f359f343ab4a3d9550f /src/mgr/DaemonServer.cc | |
parent | Merge pull request #22061 from tspmelo/wip-npmrc (diff) | |
download | ceph-705e4566eebcb26530f5b7a5d2f1920719b50d14.tar.xz ceph-705e4566eebcb26530f5b7a5d2f1920719b50d14.zip |
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 <kchai@redhat.com>
Diffstat (limited to 'src/mgr/DaemonServer.cc')
-rw-r--r-- | src/mgr/DaemonServer.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index bacb485a210..156c431cd16 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1826,26 +1826,26 @@ void DaemonServer::send_report() }); map<daemon_metric, unique_ptr<DaemonHealthMetricCollector>> 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<uint8_t>(metric.get_type()) << dendl; + derr << __func__ << " " << key.first << "." << key.second + << " sent me an unknown health metric: " + << hex << static_cast<uint8_t>(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); } } } |