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/tests/src/test_trigger_actions.cpp b/tests/src/test_trigger_actions.cpp
index 7a65fa2..1c36326 100644
--- a/tests/src/test_trigger_actions.cpp
+++ b/tests/src/test_trigger_actions.cpp
@@ -46,7 +46,7 @@
 
 TEST_P(TestLogToJournalNumeric, commitAnActionDoesNotThrow)
 {
-    EXPECT_NO_THROW(sut->commit("Test", 100'000, commmitValue));
+    EXPECT_NO_THROW(sut->commit("Test", Milliseconds{100'000}, commmitValue));
 }
 
 class TestLogToJournalNumericThrow : public TestLogToJournalNumeric
@@ -56,7 +56,7 @@
 
 TEST_P(TestLogToJournalNumericThrow, commitAnActionExpectThrow)
 {
-    EXPECT_THROW(sut->commit("Test", 100'000, commmitValue),
+    EXPECT_THROW(sut->commit("Test", Milliseconds{100'000}, commmitValue),
                  std::runtime_error);
 }
 
@@ -79,7 +79,7 @@
 
 TEST_P(TestLogToRedfishNumeric, commitExpectNoThrow)
 {
-    EXPECT_NO_THROW(sut->commit("Test", 100'000, commmitValue));
+    EXPECT_NO_THROW(sut->commit("Test", Milliseconds{100'000}, commmitValue));
 }
 
 class TestLogToRedfishNumericThrow : public TestLogToRedfishNumeric
@@ -89,7 +89,7 @@
 
 TEST_P(TestLogToRedfishNumericThrow, commitExpectToThrow)
 {
-    EXPECT_THROW(sut->commit("Test", 100'000, commmitValue),
+    EXPECT_THROW(sut->commit("Test", Milliseconds{100'000}, commmitValue),
                  std::runtime_error);
 }
 
@@ -130,7 +130,7 @@
 
 TEST_P(TestLogToJournalDiscrete, commitAnActionDoesNotThrow)
 {
-    EXPECT_NO_THROW(sut->commit("Test", 100'000, 90.0));
+    EXPECT_NO_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0));
 }
 
 class TestLogToJournalDiscreteThrow : public TestLogToJournalDiscrete
@@ -141,7 +141,8 @@
 
 TEST_P(TestLogToJournalDiscreteThrow, commitAnActionExpectThrow)
 {
-    EXPECT_THROW(sut->commit("Test", 100'000, 90.0), std::runtime_error);
+    EXPECT_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0),
+                 std::runtime_error);
 }
 
 class TestLogToRedfishDiscrete :
@@ -163,7 +164,7 @@
 
 TEST_P(TestLogToRedfishDiscrete, commitExpectNoThrow)
 {
-    EXPECT_NO_THROW(sut->commit("Test", 100'000, 90.0));
+    EXPECT_NO_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0));
 }
 
 class TestLogToRedfishDiscreteThrow : public TestLogToRedfishDiscrete
@@ -174,7 +175,8 @@
 
 TEST_P(TestLogToRedfishDiscreteThrow, commitExpectToThrow)
 {
-    EXPECT_THROW(sut->commit("Test", 100'000, 90.0), std::runtime_error);
+    EXPECT_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0),
+                 std::runtime_error);
 }
 
 namespace onChange
@@ -192,7 +194,7 @@
 
 TEST_F(TestLogToJournalDiscreteOnChange, commitExpectNoThrow)
 {
-    EXPECT_NO_THROW(sut->commit("Test", 100'000, 90.0));
+    EXPECT_NO_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0));
 }
 
 class TestLogToRedfishDiscreteOnChange : public Test
@@ -208,7 +210,7 @@
 
 TEST_F(TestLogToRedfishDiscreteOnChange, commitExpectNoThrow)
 {
-    EXPECT_NO_THROW(sut->commit("Test", 100'000, 90.0));
+    EXPECT_NO_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0));
 }
 } // namespace onChange
 } // namespace discrete
@@ -230,7 +232,7 @@
     EXPECT_CALL(reportManager, updateReport(_)).Times(0);
 
     make({});
-    sut->commit("Test", 100'000, 90.0);
+    sut->commit("Test", Milliseconds{100'000}, 90.0);
 }
 
 TEST_F(TestUpdateReport, commitExpectReportUpdate)
@@ -242,7 +244,7 @@
     }
 
     make(names);
-    sut->commit("Test", 100'000, 90.0);
+    sut->commit("Test", Milliseconds{100'000}, 90.0);
 }
 
 } // namespace action