report_manager.hpp (dcc4e1936173a93251a02066432bc2bcbc386240) report_manager.hpp (7e098e93ef0974739459d296f99ddfab54722c23)
1#pragma once
2
3#include "interfaces/json_storage.hpp"
4#include "interfaces/report.hpp"
5#include "interfaces/report_factory.hpp"
6#include "interfaces/report_manager.hpp"
7
8#include <systemd/sd-bus-protocol.h>

--- 29 unchanged lines hidden (view full) ---

38 std::unique_ptr<sdbusplus::asio::dbus_interface> reportManagerIface;
39 std::vector<std::unique_ptr<interfaces::Report>> reports;
40
41 void verifyReportNameLength(const std::string& reportName);
42 void verifyAddReport(
43 const std::string& reportName, const std::string& reportingType,
44 Milliseconds interval,
45 const std::vector<LabeledMetricParameters>& readingParams);
1#pragma once
2
3#include "interfaces/json_storage.hpp"
4#include "interfaces/report.hpp"
5#include "interfaces/report_factory.hpp"
6#include "interfaces/report_manager.hpp"
7
8#include <systemd/sd-bus-protocol.h>

--- 29 unchanged lines hidden (view full) ---

38 std::unique_ptr<sdbusplus::asio::dbus_interface> reportManagerIface;
39 std::vector<std::unique_ptr<interfaces::Report>> reports;
40
41 void verifyReportNameLength(const std::string& reportName);
42 void verifyAddReport(
43 const std::string& reportName, const std::string& reportingType,
44 Milliseconds interval,
45 const std::vector<LabeledMetricParameters>& readingParams);
46 interfaces::Report& addReport(boost::asio::yield_context& yield,
47 const std::string& reportName,
48 const std::string& reportingType,
49 const bool emitsReadingsUpdate,
50 const bool logToMetricReportsCollection,
51 Milliseconds interval,
52 ReadingParameters metricParams);
53 interfaces::Report& addReport(
46 interfaces::Report& addReport(
47 boost::asio::yield_context& yield, const std::string& reportName,
48 const std::string& reportingType, const bool emitsReadingsUpdate,
49 const bool logToMetricReportsCollection, Milliseconds interval,
50 ReadingParameters metricParams, const bool enabled);
51 interfaces::Report& addReport(
54 const std::string& reportName, const std::string& reportingType,
55 const bool emitsReadingsUpdate, const bool logToMetricReportsCollection,
56 Milliseconds interval,
52 const std::string& reportName, const std::string& reportingType,
53 const bool emitsReadingsUpdate, const bool logToMetricReportsCollection,
54 Milliseconds interval,
57 std::vector<LabeledMetricParameters> metricParams);
55 std::vector<LabeledMetricParameters> metricParams, const bool enabled);
58 void loadFromPersistent();
59
60 public:
61 static constexpr size_t maxReports{TELEMETRY_MAX_REPORTS};
62 static constexpr size_t maxReadingParams{TELEMETRY_MAX_READING_PARAMS};
63 static constexpr size_t maxReportNameLength{
64 TELEMETRY_MAX_REPORT_NAME_LENGTH};
65 static constexpr Milliseconds minInterval{TELEMETRY_MIN_INTERVAL};
66 static constexpr const char* reportManagerIfaceName =
67 "xyz.openbmc_project.Telemetry.ReportManager";
68 static constexpr const char* reportManagerPath =
69 "/xyz/openbmc_project/Telemetry/Reports";
70 static constexpr std::array<std::string_view, 2> supportedReportingType = {
71 "Periodic", "OnRequest"};
72};
56 void loadFromPersistent();
57
58 public:
59 static constexpr size_t maxReports{TELEMETRY_MAX_REPORTS};
60 static constexpr size_t maxReadingParams{TELEMETRY_MAX_READING_PARAMS};
61 static constexpr size_t maxReportNameLength{
62 TELEMETRY_MAX_REPORT_NAME_LENGTH};
63 static constexpr Milliseconds minInterval{TELEMETRY_MIN_INTERVAL};
64 static constexpr const char* reportManagerIfaceName =
65 "xyz.openbmc_project.Telemetry.ReportManager";
66 static constexpr const char* reportManagerPath =
67 "/xyz/openbmc_project/Telemetry/Reports";
68 static constexpr std::array<std::string_view, 2> supportedReportingType = {
69 "Periodic", "OnRequest"};
70};