#pragma once
#include <cstdint>
+#include <ostream>
#include "include/denc.h"
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;
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;
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;
}
}
<< static_cast<uint8_t>(metric.get_type()) << dendl;
continue;
}
+ dout(20) << " + " << daemon.second->key << " "
+ << metric << dendl;
tie(acc, std::ignore) = accumulated.emplace(metric.get_type(),
std::move(collector));
}