Changed dbus add report interface
- metric parameters now take single sensor instead of list
- added interface support for new operation types
Tested:
- All telemetry tests are passing.
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: Id3a41c48e81a287e7d205ae1c747daa36d4cdb29
diff --git a/src/metric.hpp b/src/metric.hpp
index 39f525c..aab4d15 100644
--- a/src/metric.hpp
+++ b/src/metric.hpp
@@ -10,11 +10,11 @@
public std::enable_shared_from_this<Metric>
{
public:
- Metric(std::vector<std::shared_ptr<interfaces::Sensor>> sensors,
- std::string operationType, std::string id, std::string metadata);
+ Metric(std::shared_ptr<interfaces::Sensor> sensor,
+ OperationType operationType, std::string id, std::string metadata);
void initialize() override;
- const std::vector<MetricValue>& getReadings() const override;
+ const MetricValue& getReading() const override;
void sensorUpdated(interfaces::Sensor&, uint64_t) override;
void sensorUpdated(interfaces::Sensor&, uint64_t, double value) override;
LabeledMetricParameters dumpConfiguration() const override;
@@ -22,9 +22,7 @@
private:
MetricValue& findMetric(interfaces::Sensor&);
- std::vector<std::shared_ptr<interfaces::Sensor>> sensors;
- std::string operationType;
- std::string id;
- std::string metadata;
- std::vector<MetricValue> readings;
+ std::shared_ptr<interfaces::Sensor> sensor;
+ OperationType operationType;
+ MetricValue reading;
};