Created metric class
Metric collects updates from sensor. Report displays metric readings
depending on reportingType.
Tested:
- Added new units tests for Metric class
- All other unit tests are passing
Change-Id: I19f4831fab163a4f9540cef7bb23e903ae90fddf
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/report_factory.hpp b/src/report_factory.hpp
index bdf9268..0346441 100644
--- a/src/report_factory.hpp
+++ b/src/report_factory.hpp
@@ -2,6 +2,7 @@
#include "interfaces/report_factory.hpp"
#include "interfaces/sensor.hpp"
+#include "sensor_cache.hpp"
#include <boost/asio/io_context.hpp>
#include <sdbusplus/asio/object_server.hpp>
@@ -22,6 +23,19 @@
interfaces::JsonStorage& reportStorage) const override;
private:
+ using SensorPath = std::string;
+ using ServiceName = std::string;
+ using Ifaces = std::vector<std::string>;
+ using SensorIfaces = std::vector<std::pair<ServiceName, Ifaces>>;
+ using SensorTree = std::pair<SensorPath, SensorIfaces>;
+
+ std::vector<std::shared_ptr<interfaces::Sensor>> getSensors(
+ const std::optional<std::vector<SensorTree>>& tree,
+ const std::vector<sdbusplus::message::object_path>& sensorPaths) const;
+ std::vector<SensorTree>
+ getSensorTree(boost::asio::yield_context& yield) const;
+
std::shared_ptr<sdbusplus::asio::connection> bus;
std::shared_ptr<sdbusplus::asio::object_server> objServer;
+ mutable SensorCache sensorCache;
};