drop the collection frequency from health metric

Drop the collection frequency from health metric config and its
corresponding code as collection frequency has been moved to
monitor specific property rather than metric.

Change-Id: If8345581552b99397487cf5d67865f44e1b2fc2e
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/health_metric_config.cpp b/health_metric_config.cpp
index 1570f12..88f0972 100644
--- a/health_metric_config.cpp
+++ b/health_metric_config.cpp
@@ -73,10 +73,6 @@
 /** Deserialize a HealthMetric from JSON. */
 void from_json(const json& j, HealthMetric& self)
 {
-    self.collectionFreq = std::chrono::seconds(j.value(
-        "Frequency",
-        std::chrono::seconds(HealthMetric::defaults::frequency).count()));
-
     self.windowSize = j.value("Window_size",
                               HealthMetric::defaults::windowSize);
     // Path is only valid for storage
@@ -143,10 +139,9 @@
         for (auto& config : configList)
         {
             debug(
-                "TYPE={TYPE}, NAME={NAME} SUBTYPE={SUBTYPE} PATH={PATH}, FREQ={FREQ}, WSIZE={WSIZE}",
+                "TYPE={TYPE}, NAME={NAME} SUBTYPE={SUBTYPE} PATH={PATH}, WSIZE={WSIZE}",
                 "TYPE", type, "NAME", config.name, "SUBTYPE", config.subType,
-                "PATH", config.path, "FREQ", config.collectionFreq.count(),
-                "WSIZE", config.windowSize);
+                "PATH", config.path, "WSIZE", config.windowSize);
 
             for (auto& [key, threshold] : config.thresholds)
             {
@@ -198,7 +193,6 @@
 
 json defaultHealthMetricConfig = R"({
     "CPU": {
-        "Frequency": 1,
         "Window_size": 120,
         "Threshold": {
             "Critical_Upper": {
@@ -214,19 +208,15 @@
         }
     },
     "CPU_User": {
-        "Frequency": 1,
         "Window_size": 120
     },
     "CPU_Kernel": {
-        "Frequency": 1,
         "Window_size": 120
     },
     "Memory": {
-        "Frequency": 1,
         "Window_size": 120
     },
     "Memory_Available": {
-        "Frequency": 1,
         "Window_size": 120,
         "Threshold": {
             "Critical_Lower": {
@@ -237,11 +227,9 @@
         }
     },
     "Memory_Free": {
-        "Frequency": 1,
         "Window_size": 120
     },
     "Memory_Shared": {
-        "Frequency": 1,
         "Window_size": 120,
         "Threshold": {
             "Critical_Upper": {
@@ -252,12 +240,10 @@
         }
     },
     "Memory_Buffered_And_Cached": {
-        "Frequency": 1,
         "Window_size": 120
     },
     "Storage_RW": {
         "Path": "/run/initramfs/rw",
-        "Frequency": 1,
         "Window_size": 120,
         "Threshold": {
             "Critical_Lower": {
@@ -269,7 +255,6 @@
     },
     "Storage_TMP": {
         "Path": "/tmp",
-        "Frequency": 1,
         "Window_size": 120,
         "Threshold": {
             "Critical_Lower": {
diff --git a/health_metric_config.hpp b/health_metric_config.hpp
index dedf2f4..5943878 100644
--- a/health_metric_config.hpp
+++ b/health_metric_config.hpp
@@ -71,8 +71,6 @@
     std::string name = "unnamed";
     /** @brief The metric subtype. */
     SubType subType = SubType::NA;
-    /** @brief The collection frequency for the metric. */
-    std::chrono::seconds collectionFreq = defaults::frequency;
     /** @brief The window size for the metric. */
     size_t windowSize = defaults::windowSize;
     /** @brief The threshold configs for the metric. */
@@ -84,7 +82,6 @@
 
     struct defaults
     {
-        static constexpr auto frequency = 1s;
         static constexpr auto windowSize = 1;
         static constexpr auto path = "";
     };
diff --git a/test/test_health_metric.cpp b/test/test_health_metric.cpp
index ad93c24..47a840a 100644
--- a/test/test_health_metric.cpp
+++ b/test/test_health_metric.cpp
@@ -36,7 +36,6 @@
     {
         config.name = "CPU_Kernel";
         config.subType = SubType::cpuKernel;
-        config.collectionFreq = ConfigIntf::HealthMetric::defaults::frequency;
         config.windowSize = 1;
         config.thresholds = {
             {{ThresholdIntf::Type::Critical, ThresholdIntf::Bound::Upper},
diff --git a/test/test_health_metric_config.cpp b/test/test_health_metric_config.cpp
index dd92296..142a814 100644
--- a/test/test_health_metric_config.cpp
+++ b/test/test_health_metric_config.cpp
@@ -63,7 +63,6 @@
         {
             EXPECT_NE(config.name, std::string(""));
             EXPECT_TRUE(isValidSubType(type, config.subType));
-            EXPECT_GE(config.collectionFreq, HealthMetric::defaults::frequency);
             EXPECT_GE(config.windowSize, HealthMetric::defaults::windowSize);
             if (config.thresholds.size())
             {