diff options
author | Krzysztof Grobelny <krzysztof.grobelny@intel.com> | 2021-06-17 16:37:57 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-05-23 02:27:07 +0300 |
commit | 479e899d5f57a67647f83b7f615d2c8565290bcf (patch) | |
tree | 37ac639250ce686746c3d748e52fcc8fb5556db3 /redfish-core/lib/metric_report.hpp | |
parent | 2c5875a20e5f7f38fac74c1850e2283e4195ff57 (diff) | |
download | bmcweb-479e899d5f57a67647f83b7f615d2c8565290bcf.tar.xz |
Switched bmcweb to use new telemetry service API
Added support for multiple MetricProperties. Added support for new
parameters: CollectionTimeScope, CollectionDuration. ReadingParameters
was not yet changed in telemetry backend, instead temporary property
ReadingParametersFutureVersion was introduced. Once bmcweb is adapted to
use ReadingParametersFutureVersion this property will be renamed in
backend to ReadingParameters. Then bmcweb will change to use
ReadingParameters. Then ReadingParametersFutureVersion will be removed
from backend and everything will be exactly like described in
phosphor-dbus-interfaces without introducing breaking changes.
Related change in phosphor-dbus-interfaces [1], [2]. This change needs
to be bumped together with [3].
Tested:
- It is possible to create MetricReportDefinitions with multiple
MetricProperties.
- Stub values for new parameters are correctly passed to telemetry
service.
- All existing telemetry service functionalities remain unchanged.
[1]: https://github.com/openbmc/phosphor-dbus-interfaces/commit/4f9c09144b60edc015291d2c120fc5b33aa0bec2
[2]: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60750
[3]: https://gerrit.openbmc.org/c/openbmc/telemetry/+/58229
Change-Id: I2cd17069e3ea015c8f5571c29278f1d50536272a
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Diffstat (limited to 'redfish-core/lib/metric_report.hpp')
-rw-r--r-- | redfish-core/lib/metric_report.hpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp index 1f21c91fed..6f26d8a52a 100644 --- a/redfish-core/lib/metric_report.hpp +++ b/redfish-core/lib/metric_report.hpp @@ -20,18 +20,16 @@ namespace redfish namespace telemetry { -using Readings = - std::vector<std::tuple<std::string, std::string, double, uint64_t>>; +using Readings = std::vector<std::tuple<std::string, double, uint64_t>>; using TimestampReadings = std::tuple<uint64_t, Readings>; inline nlohmann::json toMetricValues(const Readings& readings) { nlohmann::json metricValues = nlohmann::json::array_t(); - for (const auto& [id, metadata, sensorValue, timestamp] : readings) + for (const auto& [metadata, sensorValue, timestamp] : readings) { nlohmann::json::object_t metricReport; - metricReport["MetricId"] = id; metricReport["MetricProperty"] = metadata; metricReport["MetricValue"] = std::to_string(sensorValue); metricReport["Timestamp"] = |