made MetricValues persistent
MetricValues are persistent for reportUpdates AppendStopsWhenFull and
reportingType different than OnRequest.
Tested:
- New unit tests are passing
- Confirmed MetricValues are preserved after restarting telemetry
service
Change-Id: I7e1990fb391da9debb0d7df2f1dbda86473350cc
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/report.hpp b/src/report.hpp
index 213265c..6d8c6b4 100644
--- a/src/report.hpp
+++ b/src/report.hpp
@@ -7,6 +7,7 @@
#include "interfaces/report.hpp"
#include "interfaces/report_factory.hpp"
#include "interfaces/report_manager.hpp"
+#include "types/readings.hpp"
#include "types/report_action.hpp"
#include "types/report_types.hpp"
#include "types/report_updates.hpp"
@@ -60,7 +61,8 @@
interfaces::JsonStorage& reportStorage,
std::vector<std::shared_ptr<interfaces::Metric>> metrics,
const interfaces::ReportFactory& reportFactory, const bool enabled,
- std::unique_ptr<interfaces::Clock> clock);
+ std::unique_ptr<interfaces::Clock> clock, Readings);
+ ~Report();
Report(const Report&) = delete;
Report(Report&&) = delete;
@@ -96,10 +98,11 @@
void setReportUpdates(const ReportUpdates newReportUpdates);
static uint64_t getSensorCount(
const std::vector<std::shared_ptr<interfaces::Metric>>& metrics);
- interfaces::JsonStorage::FilePath fileName() const;
+ interfaces::JsonStorage::FilePath reportFileName() const;
std::unordered_set<std::string>
collectTriggerIds(boost::asio::io_context& ioc) const;
bool storeConfiguration() const;
+ bool shouldStoreMetricValues() const;
void updateReadings();
void updateReportingType(ReportingType);
@@ -114,8 +117,8 @@
uint64_t sensorCount;
std::optional<uint64_t> appendLimit;
ReportUpdates reportUpdates;
- CircularVector<ReadingData> readingsBuffer;
Readings readings = {};
+ CircularVector<ReadingData> readingsBuffer;
std::shared_ptr<sdbusplus::asio::object_server> objServer;
std::unique_ptr<sdbusplus::asio::dbus_interface> reportIface;
std::unique_ptr<sdbusplus::asio::dbus_interface> deleteIface;