From: Julien Collet Date: Thu, 20 Sep 2018 16:05:20 +0000 (+0200) Subject: mgr: add OSDPerfMetricReport struct to MMgrReport X-Git-Tag: v14.1.0~945^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30b47ee51cd115d9a08f164ff90a2d458336d4da;p=ceph.git mgr: add OSDPerfMetricReport struct to MMgrReport Signed-off-by: Julien Collet --- diff --git a/src/messages/MMgrReport.h b/src/messages/MMgrReport.h index e1f69bba4e88..1fbcdcd04ec7 100644 --- a/src/messages/MMgrReport.h +++ b/src/messages/MMgrReport.h @@ -18,6 +18,7 @@ #include #include "msg/Message.h" +#include "mgr/OSDPerfMetricReport.h" #include "common/perf_counters.h" #include "mgr/DaemonHealthMetric.h" @@ -75,7 +76,7 @@ public: friend factory; private: - static constexpr int HEAD_VERSION = 6; + static constexpr int HEAD_VERSION = 7; static constexpr int COMPAT_VERSION = 1; public: @@ -106,6 +107,8 @@ public: // encode map> of current config bufferlist config_bl; + std::list osd_perf_metric_reports; + void decode_payload() override { auto p = payload.cbegin(); @@ -124,6 +127,9 @@ public: if (header.version >= 6) { decode(config_bl, p); } + if (header.version >= 7) { + decode(osd_perf_metric_reports, p); + } } void encode_payload(uint64_t features) override { @@ -136,6 +142,7 @@ public: encode(daemon_status, payload); encode(daemon_health_metrics, payload); encode(config_bl, payload); + encode(osd_perf_metric_reports, payload); } const char *get_type_name() const override { return "mgrreport"; } diff --git a/src/mgr/OSDPerfMetricReport.h b/src/mgr/OSDPerfMetricReport.h new file mode 100644 index 000000000000..8868c4b889b1 --- /dev/null +++ b/src/mgr/OSDPerfMetricReport.h @@ -0,0 +1,27 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#ifndef OSD_PERF_METRIC_REPORT_H_ +#define OSD_PERF_METRIC_REPORT_H_ +#include "include/denc.h" + +#include "common/perf_counters.h" + +struct PerformanceCounterDescriptor { + std::string name; + perfcounter_type_d type; +}; + + +struct OSDPerfMetricReport { + std::vector performance_counter_descriptors; + std::map group_packed_performance_counters; + + DENC(OSDPerfMetricReport, v, p) { + DENC_START(1, 1, p); +// denc(v.performance_counter_descriptors, p); + DENC_FINISH(p); + } +}; +WRITE_CLASS_DENC(OSDPerfMetricReport) + +#endif // OSD_PERF_METRIC_REPORT_H_