created AddReportFutureVersion dbus method
New method will support CollectionTimeScope, CollectionDuration
In order to make not breaking interface changes bmcweb will switch to
AddReportFutureVersion, then AddReport will be changed to match
AddReportFutureVersion, then redfish will switch back to use AddReport,
then AddReportFutureVersion will be removed.
Tested:
- Verified that current version of bmcweb works fine with old API
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I51a9b7fb2f4da5b8d2f688ccd5e93710352b1ac7
diff --git a/src/metric.hpp b/src/metric.hpp
index aab4d15..08684da 100644
--- a/src/metric.hpp
+++ b/src/metric.hpp
@@ -10,19 +10,25 @@
public std::enable_shared_from_this<Metric>
{
public:
- Metric(std::shared_ptr<interfaces::Sensor> sensor,
- OperationType operationType, std::string id, std::string metadata);
+ Metric(Sensors sensors, OperationType operationType, std::string id,
+ std::string metadata, CollectionTimeScope, CollectionDuration);
void initialize() override;
- const MetricValue& getReading() const override;
+ const std::vector<MetricValue>& getReadings() const override;
void sensorUpdated(interfaces::Sensor&, uint64_t) override;
void sensorUpdated(interfaces::Sensor&, uint64_t, double value) override;
LabeledMetricParameters dumpConfiguration() const override;
private:
+ void tryUnpackJsonMetadata();
+
MetricValue& findMetric(interfaces::Sensor&);
- std::shared_ptr<interfaces::Sensor> sensor;
+ std::string id;
+ std::string metadata;
+ std::vector<MetricValue> readings;
+ Sensors sensors;
OperationType operationType;
- MetricValue reading;
+ CollectionTimeScope timeScope;
+ CollectionDuration collectionDuration;
};