Fixed issue with wrong timestamp
Telemetry service used steady_clock for generating timestamps, but it
produced incorrect time. This change makes telemetry service use
steady_clock for intervals and system_clock for timestamps.
Changed readings timestamp to display current timestamp instead of a
time when reading was received.
Tested:
- correct timestamp is visible on dbus
- other telemetry service features are still working
Change-Id: Ic49f45640532cfffaeff5e0bd5591e6d99e5def5
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/discrete_threshold.cpp b/src/discrete_threshold.cpp
index 89a1b7c..25cc46f 100644
--- a/src/discrete_threshold.cpp
+++ b/src/discrete_threshold.cpp
@@ -37,11 +37,11 @@
}
void DiscreteThreshold::sensorUpdated(interfaces::Sensor& sensor,
- uint64_t timestamp)
+ Milliseconds timestamp)
{}
void DiscreteThreshold::sensorUpdated(interfaces::Sensor& sensor,
- uint64_t timestamp, double value)
+ Milliseconds timestamp, double value)
{
auto& [sensorName, dwell, timer] = getDetails(sensor);
@@ -60,7 +60,7 @@
}
void DiscreteThreshold::startTimer(interfaces::Sensor& sensor,
- uint64_t timestamp, double value)
+ Milliseconds timestamp, double value)
{
auto& [sensorName, dwell, timer] = getDetails(sensor);
if (dwellTime == Milliseconds::zero())
@@ -87,7 +87,7 @@
}
void DiscreteThreshold::commit(const std::string& sensorName,
- uint64_t timestamp, double value)
+ Milliseconds timestamp, double value)
{
for (const auto& action : actions)
{