fixed issue with invalid readings being visible
Before this change readings for sensors that are not yet available were
displayed as value 0.0 with timestamp 1970-01-01 which was meant to
represent invalid readings. This behaviour is undesired in case of
periodic report with appendLimit set. After this change invalid readings
are no longer visible.
Tested:
- Readings for sensors that is currently not available are not present
on redfish.
- Confirmed in new unit tests that sensor readings can appear in any
order. And produce correct results.
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I340b85017530d120f2da2cc8ac4ae1840177e78c
diff --git a/src/report.cpp b/src/report.cpp
index 945d4e6..540418a 100644
--- a/src/report.cpp
+++ b/src/report.cpp
@@ -462,7 +462,7 @@
for (const auto& metric : metrics)
{
for (const auto& [id, metadata, value, timestamp] :
- metric->getReadings())
+ metric->getUpdatedReadings())
{
if (reportUpdates == ReportUpdates::appendStopsWhenFull &&
readingsBuffer.isFull())