From: Sage Weil Date: Mon, 30 Apr 2018 20:54:46 +0000 (-0500) Subject: mgr: print daemon_health_metrics to debug log X-Git-Tag: v13.1.0~5^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=adc480e3b31f49d7d8a7aac8bf38bd0a29322d24;p=ceph.git mgr: print daemon_health_metrics to debug log Signed-off-by: Sage Weil --- diff --git a/src/mgr/DaemonHealthMetric.h b/src/mgr/DaemonHealthMetric.h index e67815d2fd96..4719fa188b97 100644 --- a/src/mgr/DaemonHealthMetric.h +++ b/src/mgr/DaemonHealthMetric.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "include/denc.h" enum class daemon_metric : uint8_t { @@ -12,6 +13,15 @@ enum class daemon_metric : uint8_t { NONE, }; +static inline const char *daemon_metric_name(daemon_metric t) { + switch (t) { + case daemon_metric::SLOW_OPS: return "SLOW_OPS"; + case daemon_metric::PENDING_CREATING_PGS: return "PENDING_CREATING_PGS"; + case daemon_metric::NONE: return "NONE"; + default: return "???"; + } +} + union daemon_metric_t { struct { uint32_t n1; @@ -54,6 +64,11 @@ public: denc(v.value.n, p); DENC_FINISH(p); } + + friend ostream& operator<<(ostream& out, const DaemonHealthMetric& m) { + return out << daemon_metric_name(m.get_type()) << "(" + << m.get_n() << "|(" << m.get_n1() << "," << m.get_n2() << "))"; + } private: daemon_metric type = daemon_metric::NONE; daemon_metric_t value; diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index ca09f3609251..421c87d8a6f4 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -561,6 +561,8 @@ bool DaemonServer::handle_report(MMgrReport *m) if (m->get_connection()->peer_is_osd() || m->get_connection()->peer_is_mon()) { // only OSD and MON send health_checks to me now daemon->daemon_health_metrics = std::move(m->daemon_health_metrics); + dout(10) << "daemon_health_metrics " << daemon->daemon_health_metrics + << dendl; } } @@ -1838,6 +1840,8 @@ void DaemonServer::send_report() << static_cast(metric.get_type()) << dendl; continue; } + dout(20) << " + " << daemon.second->key << " " + << metric << dendl; tie(acc, std::ignore) = accumulated.emplace(metric.get_type(), std::move(collector)); }