Update Trigger Actions implementation

Dbus trigger action names were modified to reflect separation of
Telemetry Service from Redfish:
- LogToLogService is renamed to LogToJournal,
- RedfishEvent was renamed to LogToRedfishEventLog

Both of those logging actions, now also include trigger id and threshold
name. Threshold naming logic:
- For discrete triggers, it can be specified by user, if left empty it
  will be changed to "{Severity} condition".
- Numeric triggers have no way of naming threshold, instead its type
  will be converted to string, example "UpperWarning"
- Discrete OnChange threshold will always be named "OnChange"

Additionally, defect was found with timestamp attached to Trigger Logs:
it was a steady_clock timestamp instead of system_clock. The function
which was supposed to format it was also working incorrectly, and was
improved to work with milliseconds. This change required major refactor
of unit tests, especially for numeric threshold.

Testing done:
- LogToJournal action is working properly,
- LogToRedfishEventLog action is working properly,
- UTs are passing.

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Iae2490682f0e9e2a610b45fd8af5cc5e21e66f35
diff --git a/src/discrete_threshold.hpp b/src/discrete_threshold.hpp
index 545a980..a471027 100644
--- a/src/discrete_threshold.hpp
+++ b/src/discrete_threshold.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "interfaces/clock.hpp"
 #include "interfaces/sensor.hpp"
 #include "interfaces/sensor_listener.hpp"
 #include "interfaces/threshold.hpp"
@@ -22,10 +23,12 @@
 {
   public:
     DiscreteThreshold(
-        boost::asio::io_context& ioc, Sensors sensors,
+        boost::asio::io_context& ioc, const std::string& triggerId,
+        Sensors sensors,
         std::vector<std::unique_ptr<interfaces::TriggerAction>> actions,
         Milliseconds dwellTime, const std::string& thresholdValue,
-        const std::string& name, const discrete::Severity severity);
+        const std::string& name, const discrete::Severity severity,
+        std::unique_ptr<interfaces::Clock> clock);
     DiscreteThreshold(const DiscreteThreshold&) = delete;
     DiscreteThreshold(DiscreteThreshold&&) = delete;
 
@@ -36,13 +39,15 @@
 
   private:
     boost::asio::io_context& ioc;
+    const std::string& triggerId;
     const std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
     const Milliseconds dwellTime;
     const std::string thresholdValue;
     const double numericThresholdValue;
-    const std::string name;
     const discrete::Severity severity;
+    const std::string name;
     bool initialized = false;
+    std::unique_ptr<interfaces::Clock> clock;
 
     struct ThresholdDetail
     {
@@ -63,8 +68,9 @@
 
     friend ThresholdOperations;
 
-    void startTimer(ThresholdDetail&, Milliseconds, double);
-    void commit(const std::string&, Milliseconds, double);
+    void startTimer(ThresholdDetail&, double);
+    void commit(const std::string&, double);
     ThresholdDetail& getDetails(const interfaces::Sensor& sensor);
     std::shared_ptr<ThresholdDetail> makeDetails(const std::string& sensorName);
+    std::string getNonEmptyName(const std::string& nameIn) const;
 };