diff --git a/meson.build b/meson.build
index 2283e20..0e36ac6 100644
--- a/meson.build
+++ b/meson.build
@@ -88,6 +88,7 @@
         'src/trigger_actions.cpp',
         'src/trigger_factory.cpp',
         'src/trigger_manager.cpp',
+        'src/types/report_types.cpp',
         'src/utils/conversion_trigger.cpp',
     ],
     dependencies: [
diff --git a/src/discrete_threshold.cpp b/src/discrete_threshold.cpp
index a93f682..efec549 100644
--- a/src/discrete_threshold.cpp
+++ b/src/discrete_threshold.cpp
@@ -3,12 +3,10 @@
 #include <phosphor-logging/log.hpp>
 
 DiscreteThreshold::DiscreteThreshold(
-    boost::asio::io_context& ioc,
-    std::vector<std::shared_ptr<interfaces::Sensor>> sensorsIn,
+    boost::asio::io_context& ioc, Sensors sensorsIn,
     std::vector<std::string> sensorNames,
     std::vector<std::unique_ptr<interfaces::TriggerAction>> actionsIn,
-    std::chrono::milliseconds dwellTimeIn, double thresholdValueIn,
-    std::string name) :
+    Milliseconds dwellTimeIn, double thresholdValueIn, std::string name) :
     ioc(ioc),
     sensors(std::move(sensorsIn)), actions(std::move(actionsIn)),
     dwellTime(dwellTimeIn), thresholdValue(thresholdValueIn), name(name)
@@ -65,7 +63,7 @@
                                    uint64_t timestamp, double value)
 {
     auto& [sensorName, dwell, timer] = getDetails(sensor);
-    if (dwellTime == std::chrono::milliseconds::zero())
+    if (dwellTime == Milliseconds::zero())
     {
         commit(sensorName, timestamp, value);
     }
diff --git a/src/discrete_threshold.hpp b/src/discrete_threshold.hpp
index 100b88d..70b2a6a 100644
--- a/src/discrete_threshold.hpp
+++ b/src/discrete_threshold.hpp
@@ -4,7 +4,8 @@
 #include "interfaces/sensor_listener.hpp"
 #include "interfaces/threshold.hpp"
 #include "interfaces/trigger_action.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/milliseconds.hpp"
+#include "types/trigger_types.hpp"
 
 #include <boost/asio/steady_timer.hpp>
 
@@ -19,12 +20,10 @@
 {
   public:
     DiscreteThreshold(
-        boost::asio::io_context& ioc,
-        std::vector<std::shared_ptr<interfaces::Sensor>> sensors,
+        boost::asio::io_context& ioc, Sensors sensors,
         std::vector<std::string> sensorNames,
         std::vector<std::unique_ptr<interfaces::TriggerAction>> actions,
-        std::chrono::milliseconds dwellTime, double thresholdValue,
-        std::string name);
+        Milliseconds dwellTime, double thresholdValue, std::string name);
     DiscreteThreshold(const DiscreteThreshold&) = delete;
     DiscreteThreshold(DiscreteThreshold&&) = delete;
     ~DiscreteThreshold()
@@ -37,9 +36,9 @@
 
   private:
     boost::asio::io_context& ioc;
-    const std::vector<std::shared_ptr<interfaces::Sensor>> sensors;
+    const Sensors sensors;
     const std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
-    const std::chrono::milliseconds dwellTime;
+    const Milliseconds dwellTime;
     const double thresholdValue;
     const std::string name;
 
diff --git a/src/interfaces/metric.hpp b/src/interfaces/metric.hpp
index deb3ed6..3279fd7 100644
--- a/src/interfaces/metric.hpp
+++ b/src/interfaces/metric.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "interfaces/types.hpp"
 #include "metric_value.hpp"
+#include "types/report_types.hpp"
 
 #include <nlohmann/json.hpp>
 
@@ -16,7 +16,7 @@
     virtual ~Metric() = default;
 
     virtual void initialize() = 0;
-    virtual const MetricValue& getReading() const = 0;
+    virtual const std::vector<MetricValue>& getReadings() const = 0;
     virtual LabeledMetricParameters dumpConfiguration() const = 0;
 };
 
diff --git a/src/interfaces/report_factory.hpp b/src/interfaces/report_factory.hpp
index 237ae7b..182973d 100644
--- a/src/interfaces/report_factory.hpp
+++ b/src/interfaces/report_factory.hpp
@@ -3,7 +3,7 @@
 #include "interfaces/json_storage.hpp"
 #include "interfaces/report.hpp"
 #include "interfaces/report_manager.hpp"
-#include "interfaces/types.hpp"
+#include "types/report_types.hpp"
 
 #include <boost/asio/spawn.hpp>
 
@@ -19,17 +19,15 @@
   public:
     virtual ~ReportFactory() = default;
 
-    virtual std::unique_ptr<interfaces::Report> make(
-        boost::asio::yield_context& yield, const std::string& name,
-        const std::string& reportingType, bool emitsReadingsSignal,
-        bool logToMetricReportsCollection, std::chrono::milliseconds period,
-        const ReadingParameters& metricParams, ReportManager& reportManager,
-        JsonStorage& reportStorage) const = 0;
+    virtual std::vector<LabeledMetricParameters>
+        convertMetricParams(boost::asio::yield_context& yield,
+                            const ReadingParameters& metricParams) const = 0;
+
     virtual std::unique_ptr<interfaces::Report> make(
         const std::string& name, const std::string& reportingType,
         bool emitsReadingsSignal, bool logToMetricReportsCollection,
-        std::chrono::milliseconds period, const ReadingParameters& metricParams,
-        ReportManager& reportManager, JsonStorage& reportStorage,
+        Milliseconds period, ReportManager& reportManager,
+        JsonStorage& reportStorage,
         std::vector<LabeledMetricParameters> labeledMetricParams) const = 0;
 };
 
diff --git a/src/interfaces/sensor.hpp b/src/interfaces/sensor.hpp
index 07c7897..3e46317 100644
--- a/src/interfaces/sensor.hpp
+++ b/src/interfaces/sensor.hpp
@@ -6,6 +6,7 @@
 #include <string>
 #include <string_view>
 #include <tuple>
+#include <vector>
 
 namespace interfaces
 {
@@ -46,3 +47,5 @@
 };
 
 } // namespace interfaces
+
+using Sensors = std::vector<std::shared_ptr<interfaces::Sensor>>;
diff --git a/src/interfaces/trigger_factory.hpp b/src/interfaces/trigger_factory.hpp
index b84ce73..a9eb55b 100644
--- a/src/interfaces/trigger_factory.hpp
+++ b/src/interfaces/trigger_factory.hpp
@@ -3,7 +3,7 @@
 #include "interfaces/json_storage.hpp"
 #include "interfaces/trigger.hpp"
 #include "interfaces/trigger_manager.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/trigger_types.hpp"
 
 #include <boost/asio/spawn.hpp>
 #include <sdbusplus/message/types.hpp>
diff --git a/src/interfaces/types.hpp b/src/interfaces/types.hpp
deleted file mode 100644
index a3a1b1c..0000000
--- a/src/interfaces/types.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-#include "operation_type.hpp"
-#include "utils/labeled_tuple.hpp"
-#include "utils/tstring.hpp"
-
-#include <sdbusplus/message/types.hpp>
-
-#include <string>
-#include <tuple>
-#include <type_traits>
-#include <vector>
-
-using ReadingParameters =
-    std::vector<std::tuple<sdbusplus::message::object_path, std::string,
-                           std::string, std::string>>;
-
-using LabeledSensorParameters =
-    utils::LabeledTuple<std::tuple<std::string, std::string>,
-                        utils::tstring::Service, utils::tstring::Path>;
-
-using LabeledMetricParameters =
-    utils::LabeledTuple<std::tuple<LabeledSensorParameters, OperationType,
-                                   std::string, std::string>,
-                        utils::tstring::SensorPath,
-                        utils::tstring::OperationType, utils::tstring::Id,
-                        utils::tstring::MetricMetadata>;
-
-using Readings = std::tuple<
-    uint64_t,
-    std::vector<std::tuple<std::string, std::string, double, uint64_t>>>;
\ No newline at end of file
diff --git a/src/metric.cpp b/src/metric.cpp
index 2a73536..6734d28 100644
--- a/src/metric.cpp
+++ b/src/metric.cpp
@@ -1,27 +1,36 @@
 #include "metric.hpp"
 
-#include "interfaces/types.hpp"
+#include "types/report_types.hpp"
+#include "utils/json.hpp"
 #include "utils/transform.hpp"
 
 #include <algorithm>
 
-Metric::Metric(std::shared_ptr<interfaces::Sensor> sensor,
-               OperationType operationType, std::string id,
-               std::string metadata) :
-    sensor(std::move(sensor)),
-    operationType(std::move(operationType)), reading{std::move(id),
-                                                     std::move(metadata), 0.,
-                                                     0u}
-{}
+Metric::Metric(Sensors sensorsIn, OperationType operationTypeIn,
+               std::string idIn, std::string metadataIn,
+               CollectionTimeScope timeScopeIn,
+               CollectionDuration collectionDurationIn) :
+    id(idIn),
+    metadata(metadataIn),
+    readings(sensorsIn.size(),
+             MetricValue{std::move(idIn), std::move(metadataIn), 0., 0u}),
+    sensors(std::move(sensorsIn)), operationType(operationTypeIn),
+    timeScope(timeScopeIn), collectionDuration(collectionDurationIn)
+{
+    tryUnpackJsonMetadata();
+}
 
 void Metric::initialize()
 {
-    sensor->registerForUpdates(weak_from_this());
+    for (const auto& sensor : sensors)
+    {
+        sensor->registerForUpdates(weak_from_this());
+    }
 }
 
-const MetricValue& Metric::getReading() const
+const std::vector<MetricValue>& Metric::getReadings() const
 {
-    return reading;
+    return readings;
 }
 
 void Metric::sensorUpdated(interfaces::Sensor& notifier, uint64_t timestamp)
@@ -40,17 +49,41 @@
 
 MetricValue& Metric::findMetric(interfaces::Sensor& notifier)
 {
-    if (sensor.get() != &notifier)
-    {
-        throw std::out_of_range("unknown sensor");
-    }
-    return reading;
+    auto it = std::find_if(
+        sensors.begin(), sensors.end(),
+        [&notifier](const auto& sensor) { return sensor.get() == &notifier; });
+    auto index = std::distance(sensors.begin(), it);
+    return readings.at(index);
 }
 
 LabeledMetricParameters Metric::dumpConfiguration() const
 {
-    auto sensorPath =
-        LabeledSensorParameters(sensor->id().service, sensor->id().path);
-    return LabeledMetricParameters(std::move(sensorPath), operationType,
-                                   reading.id, reading.metadata);
+    auto sensorPath = utils::transform(sensors, [this](const auto& sensor) {
+        return LabeledSensorParameters(sensor->id().service, sensor->id().path);
+    });
+
+    return LabeledMetricParameters(std::move(sensorPath), operationType, id,
+                                   metadata, timeScope, collectionDuration);
+}
+
+void Metric::tryUnpackJsonMetadata()
+{
+    try
+    {
+        const nlohmann::json parsedMetadata = nlohmann::json::parse(metadata);
+        if (const auto metricProperties =
+                utils::readJson<std::vector<std::string>>(parsedMetadata,
+                                                          "MetricProperties"))
+        {
+            if (readings.size() == metricProperties->size())
+            {
+                for (size_t i = 0; i < readings.size(); ++i)
+                {
+                    readings[i].metadata = (*metricProperties)[i];
+                }
+            }
+        }
+    }
+    catch (const nlohmann::json::parse_error& e)
+    {}
 }
diff --git a/src/metric.hpp b/src/metric.hpp
index aab4d15..08684da 100644
--- a/src/metric.hpp
+++ b/src/metric.hpp
@@ -10,19 +10,25 @@
     public std::enable_shared_from_this<Metric>
 {
   public:
-    Metric(std::shared_ptr<interfaces::Sensor> sensor,
-           OperationType operationType, std::string id, std::string metadata);
+    Metric(Sensors sensors, OperationType operationType, std::string id,
+           std::string metadata, CollectionTimeScope, CollectionDuration);
 
     void initialize() override;
-    const MetricValue& getReading() const override;
+    const std::vector<MetricValue>& getReadings() const override;
     void sensorUpdated(interfaces::Sensor&, uint64_t) override;
     void sensorUpdated(interfaces::Sensor&, uint64_t, double value) override;
     LabeledMetricParameters dumpConfiguration() const override;
 
   private:
+    void tryUnpackJsonMetadata();
+
     MetricValue& findMetric(interfaces::Sensor&);
 
-    std::shared_ptr<interfaces::Sensor> sensor;
+    std::string id;
+    std::string metadata;
+    std::vector<MetricValue> readings;
+    Sensors sensors;
     OperationType operationType;
-    MetricValue reading;
+    CollectionTimeScope timeScope;
+    CollectionDuration collectionDuration;
 };
diff --git a/src/numeric_threshold.cpp b/src/numeric_threshold.cpp
index 5cc2be5..ebb7826 100644
--- a/src/numeric_threshold.cpp
+++ b/src/numeric_threshold.cpp
@@ -3,11 +3,10 @@
 #include <phosphor-logging/log.hpp>
 
 NumericThreshold::NumericThreshold(
-    boost::asio::io_context& ioc,
-    std::vector<std::shared_ptr<interfaces::Sensor>> sensorsIn,
+    boost::asio::io_context& ioc, Sensors sensorsIn,
     std::vector<std::string> sensorNames,
     std::vector<std::unique_ptr<interfaces::TriggerAction>> actionsIn,
-    std::chrono::milliseconds dwellTimeIn, numeric::Direction direction,
+    Milliseconds dwellTimeIn, numeric::Direction direction,
     double thresholdValueIn) :
     ioc(ioc),
     sensors(std::move(sensorsIn)), actions(std::move(actionsIn)),
@@ -72,7 +71,7 @@
                                   uint64_t timestamp, double value, bool& dwell,
                                   boost::asio::steady_timer& timer)
 {
-    if (dwellTime == std::chrono::milliseconds::zero())
+    if (dwellTime == Milliseconds::zero())
     {
         commit(sensorName, timestamp, value);
     }
diff --git a/src/numeric_threshold.hpp b/src/numeric_threshold.hpp
index 0951956..338d00b 100644
--- a/src/numeric_threshold.hpp
+++ b/src/numeric_threshold.hpp
@@ -4,7 +4,8 @@
 #include "interfaces/sensor_listener.hpp"
 #include "interfaces/threshold.hpp"
 #include "interfaces/trigger_action.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/milliseconds.hpp"
+#include "types/trigger_types.hpp"
 
 #include <boost/asio/steady_timer.hpp>
 
@@ -19,11 +20,10 @@
 {
   public:
     NumericThreshold(
-        boost::asio::io_context& ioc,
-        std::vector<std::shared_ptr<interfaces::Sensor>> sensors,
+        boost::asio::io_context& ioc, Sensors sensors,
         std::vector<std::string> sensorNames,
         std::vector<std::unique_ptr<interfaces::TriggerAction>> actions,
-        std::chrono::milliseconds dwellTime, numeric::Direction direction,
+        Milliseconds dwellTime, numeric::Direction direction,
         double thresholdValue);
     ~NumericThreshold();
 
@@ -33,9 +33,9 @@
 
   private:
     boost::asio::io_context& ioc;
-    const std::vector<std::shared_ptr<interfaces::Sensor>> sensors;
+    const Sensors sensors;
     const std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
-    const std::chrono::milliseconds dwellTime;
+    const Milliseconds dwellTime;
     const numeric::Direction direction;
     const double thresholdValue;
 
diff --git a/src/on_change_threshold.cpp b/src/on_change_threshold.cpp
index 0365ef4..5285ee3 100644
--- a/src/on_change_threshold.cpp
+++ b/src/on_change_threshold.cpp
@@ -3,8 +3,7 @@
 #include <phosphor-logging/log.hpp>
 
 OnChangeThreshold::OnChangeThreshold(
-    std::vector<std::shared_ptr<interfaces::Sensor>> sensorsIn,
-    std::vector<std::string> sensorNamesIn,
+    Sensors sensorsIn, std::vector<std::string> sensorNamesIn,
     std::vector<std::unique_ptr<interfaces::TriggerAction>> actionsIn) :
     sensors(std::move(sensorsIn)),
     sensorNames(std::move(sensorNamesIn)), actions(std::move(actionsIn))
diff --git a/src/on_change_threshold.hpp b/src/on_change_threshold.hpp
index 0d0f841..7eb1f6d 100644
--- a/src/on_change_threshold.hpp
+++ b/src/on_change_threshold.hpp
@@ -4,7 +4,7 @@
 #include "interfaces/sensor_listener.hpp"
 #include "interfaces/threshold.hpp"
 #include "interfaces/trigger_action.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/trigger_types.hpp"
 
 #include <boost/asio/steady_timer.hpp>
 
@@ -19,8 +19,7 @@
 {
   public:
     OnChangeThreshold(
-        std::vector<std::shared_ptr<interfaces::Sensor>> sensors,
-        std::vector<std::string> sensorNames,
+        Sensors sensors, std::vector<std::string> sensorNames,
         std::vector<std::unique_ptr<interfaces::TriggerAction>> actions);
     ~OnChangeThreshold()
     {}
@@ -30,7 +29,7 @@
     void sensorUpdated(interfaces::Sensor&, uint64_t, double) override;
 
   private:
-    const std::vector<std::shared_ptr<interfaces::Sensor>> sensors;
+    const Sensors sensors;
     const std::vector<std::string> sensorNames;
     const std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
 
diff --git a/src/report.cpp b/src/report.cpp
index 7aef423..8a7297e 100644
--- a/src/report.cpp
+++ b/src/report.cpp
@@ -14,20 +14,30 @@
                const std::string& reportingTypeIn,
                const bool emitsReadingsUpdateIn,
                const bool logToMetricReportsCollectionIn,
-               const std::chrono::milliseconds intervalIn,
-               const ReadingParameters& readingParametersIn,
+               const Milliseconds intervalIn,
                interfaces::ReportManager& reportManager,
                interfaces::JsonStorage& reportStorageIn,
-               std::vector<std::shared_ptr<interfaces::Metric>> metrics) :
+               std::vector<std::shared_ptr<interfaces::Metric>> metricsIn) :
     name(reportName),
     path(reportDir + name), reportingType(reportingTypeIn),
     interval(intervalIn), emitsReadingsUpdate(emitsReadingsUpdateIn),
     logToMetricReportsCollection(logToMetricReportsCollectionIn),
-    readingParameters(readingParametersIn), objServer(objServer),
-    metrics(std::move(metrics)), timer(ioc),
+    objServer(objServer), metrics(std::move(metricsIn)), timer(ioc),
     fileName(std::to_string(std::hash<std::string>{}(name))),
     reportStorage(reportStorageIn)
 {
+    readingParameters =
+        toReadingParameters(utils::transform(metrics, [](const auto& metric) {
+            return metric->dumpConfiguration();
+        }));
+
+    readingParametersPastVersion =
+        utils::transform(readingParameters, [](const auto& item) {
+            return ReadingParametersPastVersion::value_type(
+                std::get<0>(item).front(), std::get<1>(item), std::get<2>(item),
+                std::get<3>(item));
+        });
+
     deleteIface = objServer->add_unique_interface(
         path, deleteIfaceName, [this, &ioc, &reportManager](auto& dbusIface) {
             dbusIface.register_method("Delete", [this, &ioc, &reportManager] {
@@ -59,10 +69,10 @@
 {
     auto dbusIface = objServer->add_unique_interface(path, reportIfaceName);
     dbusIface->register_property_rw(
-        "Interval", static_cast<uint64_t>(interval.count()),
+        "Interval", interval.count(),
         sdbusplus::vtable::property_::emits_change,
         [this](uint64_t newVal, auto&) {
-            std::chrono::milliseconds newValT(newVal);
+            Milliseconds newValT(newVal);
             if (newValT < ReportManager::minInterval)
             {
                 return false;
@@ -70,9 +80,7 @@
             interval = newValT;
             return true;
         },
-        [this](const auto&) {
-            return static_cast<uint64_t>(interval.count());
-        });
+        [this](const auto&) { return interval.count(); });
     dbusIface->register_property_rw(
         "Persistency", persistency, sdbusplus::vtable::property_::emits_change,
         [this](bool newVal, const auto&) {
@@ -104,7 +112,11 @@
         "ReportingType", reportingType, sdbusplus::vtable::property_::const_,
         [this](const auto&) { return reportingType; });
     dbusIface->register_property_r(
-        "ReadingParameters", readingParameters,
+        "ReadingParameters", readingParametersPastVersion,
+        sdbusplus::vtable::property_::const_,
+        [this](const auto&) { return readingParametersPastVersion; });
+    dbusIface->register_property_r(
+        "ReadingParametersFutureVersion", readingParameters,
         sdbusplus::vtable::property_::const_,
         [this](const auto&) { return readingParameters; });
     dbusIface->register_property_r(
@@ -137,7 +149,7 @@
     self.scheduleTimer(self.interval);
 }
 
-void Report::scheduleTimer(std::chrono::milliseconds timerInterval)
+void Report::scheduleTimer(Milliseconds timerInterval)
 {
     timer.expires_after(timerInterval);
     timer.async_wait(
@@ -146,17 +158,23 @@
 
 void Report::updateReadings()
 {
-    std::tuple_element_t<1, Readings> readingsCache(metrics.size());
+    using ReadingsValue = std::tuple_element_t<1, Readings>;
+    std::get<ReadingsValue>(cachedReadings).clear();
 
-    std::transform(std::begin(metrics), std::end(metrics),
-                   std::begin(readingsCache), [](const auto& metric) {
-                       const auto& reading = metric->getReading();
-                       return std::make_tuple(reading.id, reading.metadata,
-                                              reading.value, reading.timestamp);
-                   });
+    for (const auto& metric : metrics)
+    {
+        for (const auto& reading : metric->getReadings())
+        {
+            std::get<1>(cachedReadings)
+                .emplace_back(reading.id, reading.metadata, reading.value,
+                              reading.timestamp);
+        }
+    }
 
-    std::get<0>(readings) = std::time(0);
-    std::get<1>(readings) = std::move(readingsCache);
+    using ReadingsTimestamp = std::tuple_element_t<0, Readings>;
+    std::get<ReadingsTimestamp>(cachedReadings) = std::time(0);
+
+    std::swap(readings, cachedReadings);
 
     reportIface->signal_property("Readings");
 }
diff --git a/src/report.hpp b/src/report.hpp
index d9ecb33..92293a0 100644
--- a/src/report.hpp
+++ b/src/report.hpp
@@ -4,7 +4,7 @@
 #include "interfaces/metric.hpp"
 #include "interfaces/report.hpp"
 #include "interfaces/report_manager.hpp"
-#include "interfaces/types.hpp"
+#include "types/report_types.hpp"
 
 #include <boost/asio/io_context.hpp>
 #include <boost/asio/steady_timer.hpp>
@@ -20,9 +20,7 @@
            const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
            const std::string& reportName, const std::string& reportingType,
            const bool emitsReadingsSignal,
-           const bool logToMetricReportsCollection,
-           const std::chrono::milliseconds period,
-           const ReadingParameters& metricParams,
+           const bool logToMetricReportsCollection, const Milliseconds period,
            interfaces::ReportManager& reportManager,
            interfaces::JsonStorage& reportStorage,
            std::vector<std::shared_ptr<interfaces::Metric>> metrics);
@@ -49,16 +47,18 @@
   private:
     std::unique_ptr<sdbusplus::asio::dbus_interface> makeReportInterface();
     static void timerProc(boost::system::error_code, Report& self);
-    void scheduleTimer(std::chrono::milliseconds interval);
+    void scheduleTimer(Milliseconds interval);
 
     const std::string name;
     const std::string path;
     std::string reportingType;
-    std::chrono::milliseconds interval;
+    Milliseconds interval;
     bool emitsReadingsUpdate;
     bool logToMetricReportsCollection;
+    ReadingParametersPastVersion readingParametersPastVersion;
     ReadingParameters readingParameters;
     bool persistency = false;
+    Readings cachedReadings = {};
     Readings readings = {};
     std::shared_ptr<sdbusplus::asio::object_server> objServer;
     std::unique_ptr<sdbusplus::asio::dbus_interface> reportIface;
@@ -76,5 +76,5 @@
         "/xyz/openbmc_project/Telemetry/Reports/";
     static constexpr const char* deleteIfaceName =
         "xyz.openbmc_project.Object.Delete";
-    static constexpr size_t reportVersion = 3;
+    static constexpr size_t reportVersion = 4;
 };
diff --git a/src/report_factory.cpp b/src/report_factory.cpp
index 9dfdbb0..fb6edf9 100644
--- a/src/report_factory.cpp
+++ b/src/report_factory.cpp
@@ -16,24 +16,9 @@
 {}
 
 std::unique_ptr<interfaces::Report> ReportFactory::make(
-    boost::asio::yield_context& yield, const std::string& name,
-    const std::string& reportingType, bool emitsReadingsSignal,
-    bool logToMetricReportsCollection, std::chrono::milliseconds period,
-    const ReadingParameters& metricParams,
-    interfaces::ReportManager& reportManager,
-    interfaces::JsonStorage& reportStorage) const
-{
-    return make(name, reportingType, emitsReadingsSignal,
-                logToMetricReportsCollection, period, metricParams,
-                reportManager, reportStorage,
-                convertMetricParams(yield, metricParams));
-}
-
-std::unique_ptr<interfaces::Report> ReportFactory::make(
     const std::string& name, const std::string& reportingType,
     bool emitsReadingsSignal, bool logToMetricReportsCollection,
-    std::chrono::milliseconds period, const ReadingParameters& metricParams,
-    interfaces::ReportManager& reportManager,
+    Milliseconds period, interfaces::ReportManager& reportManager,
     interfaces::JsonStorage& reportStorage,
     std::vector<LabeledMetricParameters> labeledMetricParams) const
 {
@@ -41,25 +26,35 @@
         labeledMetricParams,
         [this](const LabeledMetricParameters& param)
             -> std::shared_ptr<interfaces::Metric> {
+            namespace ts = utils::tstring;
+
             return std::make_shared<Metric>(
-                getSensor(param.at_index<0>()), param.at_index<1>(),
-                param.at_index<2>(), param.at_index<3>());
+                getSensors(param.at_label<ts::SensorPath>()),
+                param.at_label<ts::OperationType>(), param.at_label<ts::Id>(),
+                param.at_label<ts::MetricMetadata>(),
+                param.at_label<ts::CollectionTimeScope>(),
+                param.at_label<ts::CollectionDuration>());
         });
 
     return std::make_unique<Report>(
         bus->get_io_context(), objServer, name, reportingType,
-        emitsReadingsSignal, logToMetricReportsCollection, period, metricParams,
+        emitsReadingsSignal, logToMetricReportsCollection, period,
         reportManager, reportStorage, std::move(metrics));
 }
 
-std::shared_ptr<interfaces::Sensor>
-    ReportFactory::getSensor(const LabeledSensorParameters& sensorPath) const
+Sensors ReportFactory::getSensors(
+    const std::vector<LabeledSensorParameters>& sensorPaths) const
 {
     using namespace utils::tstring;
 
-    return sensorCache.makeSensor<Sensor>(sensorPath.at_label<Service>(),
-                                          sensorPath.at_label<Path>(),
-                                          bus->get_io_context(), bus);
+    return utils::transform(sensorPaths,
+                            [this](const LabeledSensorParameters& sensorPath)
+                                -> std::shared_ptr<interfaces::Sensor> {
+                                return sensorCache.makeSensor<Sensor>(
+                                    sensorPath.at_label<Service>(),
+                                    sensorPath.at_label<Path>(),
+                                    bus->get_io_context(), bus);
+                            });
 }
 
 std::vector<LabeledMetricParameters> ReportFactory::convertMetricParams(
@@ -69,22 +64,35 @@
     auto tree = utils::getSubTreeSensors(yield, bus);
 
     return utils::transform(metricParams, [&tree](const auto& item) {
-        const auto& [sensorPath, operationType, id, metadata] = item;
+        const auto& [sensorPaths, operationType, id, metadata,
+                     collectionTimeScope, collectionDuration] = item;
 
-        auto it = std::find_if(
-            tree.begin(), tree.end(),
-            [&sensorPath](const auto& v) { return v.first == sensorPath; });
+        std::vector<LabeledSensorParameters> sensorParameters;
 
-        if (it != tree.end() && it->second.size() == 1)
+        for (const auto& sensorPath : sensorPaths)
         {
-            const auto& [service, ifaces] = it->second.front();
-            return LabeledMetricParameters(
-                LabeledSensorParameters(service, sensorPath),
-                utils::stringToOperationType(operationType), id, metadata);
+            auto it = std::find_if(
+                tree.begin(), tree.end(),
+                [&sensorPath](const auto& v) { return v.first == sensorPath; });
+
+            if (it != tree.end() && it->second.size() == 1)
+            {
+                const auto& [service, ifaces] = it->second.front();
+                sensorParameters.emplace_back(service, sensorPath);
+            }
         }
 
-        throw sdbusplus::exception::SdBusError(
-            static_cast<int>(std::errc::invalid_argument),
-            "Could not find service for provided sensors");
+        if (sensorParameters.size() != sensorPaths.size())
+        {
+            throw sdbusplus::exception::SdBusError(
+                static_cast<int>(std::errc::invalid_argument),
+                "Could not find service for provided sensors");
+        }
+
+        return LabeledMetricParameters(
+            std::move(sensorParameters),
+            utils::stringToOperationType(operationType), id, metadata,
+            utils::stringToCollectionTimeScope(collectionTimeScope),
+            CollectionDuration(Milliseconds(collectionDuration)));
     });
 }
diff --git a/src/report_factory.hpp b/src/report_factory.hpp
index 550eb81..1160a6f 100644
--- a/src/report_factory.hpp
+++ b/src/report_factory.hpp
@@ -15,30 +15,21 @@
         const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
         SensorCache& sensorCache);
 
-    std::unique_ptr<interfaces::Report>
-        make(boost::asio::yield_context& yield, const std::string& name,
-             const std::string& reportingType, bool emitsReadingsSignal,
-             bool logToMetricReportsCollection,
-             std::chrono::milliseconds period,
-             const ReadingParameters& metricParams,
-             interfaces::ReportManager& reportManager,
-             interfaces::JsonStorage& reportStorage) const override;
+    std::vector<LabeledMetricParameters> convertMetricParams(
+        boost::asio::yield_context& yield,
+        const ReadingParameters& metricParams) const override;
+
     std::unique_ptr<interfaces::Report>
         make(const std::string& name, const std::string& reportingType,
              bool emitsReadingsSignal, bool logToMetricReportsCollection,
-             std::chrono::milliseconds period,
-             const ReadingParameters& metricParams,
-             interfaces::ReportManager& reportManager,
+             Milliseconds period, interfaces::ReportManager& reportManager,
              interfaces::JsonStorage& reportStorage,
              std::vector<LabeledMetricParameters> labeledMetricParams)
             const override;
 
   private:
-    std::shared_ptr<interfaces::Sensor>
-        getSensor(const LabeledSensorParameters& sensorPath) const;
-    std::vector<LabeledMetricParameters>
-        convertMetricParams(boost::asio::yield_context& yield,
-                            const ReadingParameters& metricParams) const;
+    Sensors getSensors(
+        const std::vector<LabeledSensorParameters>& sensorPaths) const;
 
     std::shared_ptr<sdbusplus::asio::connection> bus;
     std::shared_ptr<sdbusplus::asio::object_server> objServer;
diff --git a/src/report_manager.cpp b/src/report_manager.cpp
index 24087c3..e40d9a4 100644
--- a/src/report_manager.cpp
+++ b/src/report_manager.cpp
@@ -1,7 +1,7 @@
 #include "report_manager.hpp"
 
-#include "interfaces/types.hpp"
 #include "report.hpp"
+#include "types/report_types.hpp"
 #include "utils/conversion.hpp"
 #include "utils/transform.hpp"
 
@@ -11,6 +11,19 @@
 #include <stdexcept>
 #include <system_error>
 
+ReadingParameters
+    convertToReadingParameters(ReadingParametersPastVersion params)
+{
+    return utils::transform(params, [](const auto& param) {
+        using namespace std::chrono_literals;
+
+        return ReadingParameters::value_type(
+            std::vector{{std::get<0>(param)}}, std::get<1>(param),
+            std::get<2>(param), std::get<3>(param),
+            utils::enumToString(CollectionTimeScope::point), 0u);
+    });
+}
+
 ReportManager::ReportManager(
     std::unique_ptr<interfaces::ReportFactory> reportFactoryIn,
     std::unique_ptr<interfaces::JsonStorage> reportStorageIn,
@@ -42,11 +55,29 @@
                                     const bool emitsReadingsUpdate,
                                     const bool logToMetricReportsCollection,
                                     const uint64_t interval,
-                                    ReadingParameters metricParams) {
+                                    ReadingParametersPastVersion metricParams) {
                     return addReport(yield, reportName, reportingType,
                                      emitsReadingsUpdate,
                                      logToMetricReportsCollection,
-                                     std::chrono::milliseconds(interval),
+                                     Milliseconds(interval),
+                                     convertToReadingParameters(
+                                         std::move(metricParams)))
+                        .getPath();
+                });
+
+            dbusIface.register_method(
+                "AddReportFutureVersion",
+                [this](boost::asio::yield_context& yield,
+                       const std::string& reportName,
+                       const std::string& reportingType,
+                       const bool emitsReadingsUpdate,
+                       const bool logToMetricReportsCollection,
+                       const uint64_t interval,
+                       ReadingParameters metricParams) {
+                    return addReport(yield, reportName, reportingType,
+                                     emitsReadingsUpdate,
+                                     logToMetricReportsCollection,
+                                     Milliseconds(interval),
                                      std::move(metricParams))
                         .getPath();
                 });
@@ -71,10 +102,10 @@
     }
 }
 
-void ReportManager::verifyAddReport(const std::string& reportName,
-                                    const std::string& reportingType,
-                                    std::chrono::milliseconds interval,
-                                    const ReadingParameters& readingParams)
+void ReportManager::verifyAddReport(
+    const std::string& reportName, const std::string& reportingType,
+    Milliseconds interval,
+    const std::vector<LabeledMetricParameters>& readingParams)
 {
     if (reports.size() >= maxReports)
     {
@@ -119,9 +150,12 @@
 
     try
     {
-        for (const auto& item : readingParams)
+        namespace ts = utils::tstring;
+
+        for (const LabeledMetricParameters& item : readingParams)
         {
-            utils::stringToOperationType(std::get<1>(item));
+            utils::toOperationType(
+                utils::toUnderlying(item.at_label<ts::OperationType>()));
         }
     }
     catch (const std::exception& e)
@@ -134,41 +168,29 @@
 interfaces::Report& ReportManager::addReport(
     boost::asio::yield_context& yield, const std::string& reportName,
     const std::string& reportingType, const bool emitsReadingsUpdate,
-    const bool logToMetricReportsCollection, std::chrono::milliseconds interval,
+    const bool logToMetricReportsCollection, Milliseconds interval,
     ReadingParameters metricParams)
 {
-    verifyAddReport(reportName, reportingType, interval, metricParams);
+    auto labeledMetricParams =
+        reportFactory->convertMetricParams(yield, metricParams);
 
-    reports.emplace_back(reportFactory->make(
-        yield, reportName, reportingType, emitsReadingsUpdate,
-        logToMetricReportsCollection, interval, std::move(metricParams), *this,
-        *reportStorage));
-    return *reports.back();
+    return addReport(reportName, reportingType, emitsReadingsUpdate,
+                     logToMetricReportsCollection, interval,
+                     std::move(labeledMetricParams));
 }
 
 interfaces::Report& ReportManager::addReport(
     const std::string& reportName, const std::string& reportingType,
     const bool emitsReadingsUpdate, const bool logToMetricReportsCollection,
-    std::chrono::milliseconds interval,
+    Milliseconds interval,
     std::vector<LabeledMetricParameters> labeledMetricParams)
 {
-    auto metricParams = utils::transform(
-        labeledMetricParams, [](const LabeledMetricParameters& param) {
-            using namespace utils::tstring;
+    verifyAddReport(reportName, reportingType, interval, labeledMetricParams);
 
-            return ReadingParameters::value_type(
-                sdbusplus::message::object_path(
-                    param.at_index<0>().at_label<Path>()),
-                utils::enumToString(param.at_index<1>()), param.at_index<2>(),
-                param.at_index<3>());
-        });
-
-    verifyAddReport(reportName, reportingType, interval, metricParams);
-
-    reports.emplace_back(reportFactory->make(
-        reportName, reportingType, emitsReadingsUpdate,
-        logToMetricReportsCollection, interval, std::move(metricParams), *this,
-        *reportStorage, labeledMetricParams));
+    reports.emplace_back(
+        reportFactory->make(reportName, reportingType, emitsReadingsUpdate,
+                            logToMetricReportsCollection, interval, *this,
+                            *reportStorage, labeledMetricParams));
     return *reports.back();
 }
 
@@ -200,8 +222,7 @@
                     .get<std::vector<LabeledMetricParameters>>();
 
             addReport(name, reportingType, emitsReadingsSignal,
-                      logToMetricReportsCollection,
-                      std::chrono::milliseconds(interval),
+                      logToMetricReportsCollection, Milliseconds(interval),
                       std::move(readingParameters));
         }
         catch (const std::exception& e)
diff --git a/src/report_manager.hpp b/src/report_manager.hpp
index e66a614..1e6e15d 100644
--- a/src/report_manager.hpp
+++ b/src/report_manager.hpp
@@ -39,21 +39,21 @@
     std::vector<std::unique_ptr<interfaces::Report>> reports;
 
     void verifyReportNameLength(const std::string& reportName);
-    void verifyAddReport(const std::string& reportName,
-                         const std::string& reportingType,
-                         std::chrono::milliseconds interval,
-                         const ReadingParameters& readingParams);
+    void verifyAddReport(
+        const std::string& reportName, const std::string& reportingType,
+        Milliseconds interval,
+        const std::vector<LabeledMetricParameters>& readingParams);
     interfaces::Report& addReport(boost::asio::yield_context& yield,
                                   const std::string& reportName,
                                   const std::string& reportingType,
                                   const bool emitsReadingsUpdate,
                                   const bool logToMetricReportsCollection,
-                                  std::chrono::milliseconds interval,
+                                  Milliseconds interval,
                                   ReadingParameters metricParams);
     interfaces::Report& addReport(
         const std::string& reportName, const std::string& reportingType,
         const bool emitsReadingsUpdate, const bool logToMetricReportsCollection,
-        std::chrono::milliseconds interval,
+        Milliseconds interval,
         std::vector<LabeledMetricParameters> metricParams);
     void loadFromPersistent();
 
@@ -62,8 +62,7 @@
     static constexpr size_t maxReadingParams{TELEMETRY_MAX_READING_PARAMS};
     static constexpr size_t maxReportNameLength{
         TELEMETRY_MAX_REPORT_NAME_LENGTH};
-    static constexpr std::chrono::milliseconds minInterval{
-        TELEMETRY_MIN_INTERVAL};
+    static constexpr Milliseconds minInterval{TELEMETRY_MIN_INTERVAL};
     static constexpr const char* reportManagerIfaceName =
         "xyz.openbmc_project.Telemetry.ReportManager";
     static constexpr const char* reportManagerPath =
diff --git a/src/sensor.hpp b/src/sensor.hpp
index 1374c54..e3334a0 100644
--- a/src/sensor.hpp
+++ b/src/sensor.hpp
@@ -2,6 +2,7 @@
 
 #include "interfaces/sensor.hpp"
 #include "interfaces/sensor_listener.hpp"
+#include "types/milliseconds.hpp"
 #include "utils/unique_call.hpp"
 
 #include <boost/asio/high_resolution_timer.hpp>
@@ -41,7 +42,7 @@
     interfaces::Sensor::Id sensorId;
     boost::asio::io_context& ioc;
     std::shared_ptr<sdbusplus::asio::connection> bus;
-    std::chrono::milliseconds timerInterval = std::chrono::milliseconds(0);
+    Milliseconds timerInterval = Milliseconds(0);
     std::optional<boost::asio::high_resolution_timer> timer;
 
     utils::UniqueCall uniqueCall;
diff --git a/src/trigger.cpp b/src/trigger.cpp
index 6289a05..d6ee3be 100644
--- a/src/trigger.cpp
+++ b/src/trigger.cpp
@@ -1,7 +1,7 @@
 #include "trigger.hpp"
 
-#include "interfaces/trigger_types.hpp"
-#include "interfaces/types.hpp"
+#include "types/report_types.hpp"
+#include "types/trigger_types.hpp"
 #include "utils/conversion_trigger.hpp"
 #include "utils/transform.hpp"
 
diff --git a/src/trigger.hpp b/src/trigger.hpp
index a108caf..09b5dc8 100644
--- a/src/trigger.hpp
+++ b/src/trigger.hpp
@@ -4,7 +4,7 @@
 #include "interfaces/threshold.hpp"
 #include "interfaces/trigger.hpp"
 #include "interfaces/trigger_manager.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/trigger_types.hpp"
 
 #include <boost/asio/io_context.hpp>
 #include <sdbusplus/asio/object_server.hpp>
diff --git a/src/trigger_actions.hpp b/src/trigger_actions.hpp
index 408bcb5..2b126e0 100644
--- a/src/trigger_actions.hpp
+++ b/src/trigger_actions.hpp
@@ -2,7 +2,7 @@
 
 #include "interfaces/report_manager.hpp"
 #include "interfaces/trigger_action.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/trigger_types.hpp"
 
 namespace action
 {
diff --git a/src/trigger_factory.cpp b/src/trigger_factory.cpp
index 6e2ad21..bdfc163 100644
--- a/src/trigger_factory.cpp
+++ b/src/trigger_factory.cpp
@@ -45,8 +45,8 @@
                 labeledThresholdParam.at_label<ts::UserId>();
             discrete::Severity severity =
                 labeledThresholdParam.at_label<ts::Severity>();
-            std::chrono::milliseconds dwellTime = std::chrono::milliseconds(
-                labeledThresholdParam.at_label<ts::DwellTime>());
+            auto dwellTime =
+                Milliseconds(labeledThresholdParam.at_label<ts::DwellTime>());
             std::string thresholdValue =
                 labeledThresholdParam.at_label<ts::ThresholdValue>();
 
@@ -68,7 +68,7 @@
 
             thresholds.emplace_back(std::make_shared<DiscreteThreshold>(
                 bus->get_io_context(), sensors, sensorNames, std::move(actions),
-                std::chrono::milliseconds(dwellTime), std::stod(thresholdValue),
+                Milliseconds(dwellTime), std::stod(thresholdValue),
                 thresholdName));
         }
         if (labeledDiscreteThresholdParams.empty())
@@ -106,8 +106,8 @@
         {
             std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
             auto type = labeledThresholdParam.at_label<ts::Type>();
-            auto dwellTime = std::chrono::milliseconds(
-                labeledThresholdParam.at_label<ts::DwellTime>());
+            auto dwellTime =
+                Milliseconds(labeledThresholdParam.at_label<ts::DwellTime>());
             auto direction = labeledThresholdParam.at_label<ts::Direction>();
             auto thresholdValue =
                 double{labeledThresholdParam.at_label<ts::ThresholdValue>()};
@@ -145,12 +145,10 @@
         triggerStorage);
 }
 
-std::pair<std::vector<std::shared_ptr<interfaces::Sensor>>,
-          std::vector<std::string>>
-    TriggerFactory::getSensors(
-        const std::vector<LabeledSensorInfo>& labeledSensorsInfo) const
+std::pair<Sensors, std::vector<std::string>> TriggerFactory::getSensors(
+    const std::vector<LabeledSensorInfo>& labeledSensorsInfo) const
 {
-    std::vector<std::shared_ptr<interfaces::Sensor>> sensors;
+    Sensors sensors;
     std::vector<std::string> sensorNames;
 
     for (const auto& labeledSensorInfo : labeledSensorsInfo)
diff --git a/src/trigger_factory.hpp b/src/trigger_factory.hpp
index 7c13e55..4ec273a 100644
--- a/src/trigger_factory.hpp
+++ b/src/trigger_factory.hpp
@@ -35,8 +35,6 @@
     SensorCache& sensorCache;
     interfaces::ReportManager& reportManager;
 
-    std::pair<std::vector<std::shared_ptr<interfaces::Sensor>>,
-              std::vector<std::string>>
-        getSensors(
-            const std::vector<LabeledSensorInfo>& labeledSensorsInfo) const;
+    std::pair<Sensors, std::vector<std::string>> getSensors(
+        const std::vector<LabeledSensorInfo>& labeledSensorsInfo) const;
 };
diff --git a/src/trigger_manager.cpp b/src/trigger_manager.cpp
index d9d04d2..81a0398 100644
--- a/src/trigger_manager.cpp
+++ b/src/trigger_manager.cpp
@@ -1,7 +1,7 @@
 #include "trigger_manager.hpp"
 
-#include "interfaces/trigger_types.hpp"
 #include "trigger.hpp"
+#include "types/trigger_types.hpp"
 #include "utils/conversion_trigger.hpp"
 #include "utils/transform.hpp"
 
diff --git a/src/types/collection_duration.hpp b/src/types/collection_duration.hpp
new file mode 100644
index 0000000..ddeb9cc
--- /dev/null
+++ b/src/types/collection_duration.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "types/milliseconds.hpp"
+
+#include <boost/serialization/strong_typedef.hpp>
+#include <nlohmann/json.hpp>
+
+#include <chrono>
+
+BOOST_STRONG_TYPEDEF(Milliseconds, CollectionDuration)
+
+inline void to_json(nlohmann::json& json, const CollectionDuration& value)
+{
+    json = value.t.count();
+}
+
+inline void from_json(const nlohmann::json& json, CollectionDuration& value)
+{
+    value = CollectionDuration(Milliseconds(json.get<uint64_t>()));
+}
diff --git a/src/types/collection_time_scope.hpp b/src/types/collection_time_scope.hpp
new file mode 100644
index 0000000..d2694d2
--- /dev/null
+++ b/src/types/collection_time_scope.hpp
@@ -0,0 +1,46 @@
+#pragma once
+
+#include "utils/conversion.hpp"
+
+#include <array>
+#include <cstdint>
+#include <string_view>
+#include <type_traits>
+
+enum class CollectionTimeScope : uint32_t
+{
+    point,
+    interval,
+    startup
+};
+
+namespace utils
+{
+
+constexpr std::array<std::pair<std::string_view, CollectionTimeScope>, 3>
+    convDataCollectionTimeScope = {
+        {std::make_pair<std::string_view, CollectionTimeScope>(
+             "Point", CollectionTimeScope::point),
+         std::make_pair<std::string_view, CollectionTimeScope>(
+             "Interval", CollectionTimeScope::interval),
+         std::make_pair<std::string_view, CollectionTimeScope>(
+             "StartupInterval", CollectionTimeScope::startup)}};
+
+inline CollectionTimeScope
+    toCollectionTimeScope(std::underlying_type_t<CollectionTimeScope> value)
+{
+    return toEnum<CollectionTimeScope, CollectionTimeScope::point,
+                  CollectionTimeScope::startup>(value);
+}
+
+inline CollectionTimeScope stringToCollectionTimeScope(const std::string& value)
+{
+    return stringToEnum(convDataCollectionTimeScope, value);
+}
+
+inline std::string enumToString(CollectionTimeScope value)
+{
+    return std::string(enumToString(convDataCollectionTimeScope, value));
+}
+
+} // namespace utils
\ No newline at end of file
diff --git a/src/types/milliseconds.hpp b/src/types/milliseconds.hpp
new file mode 100644
index 0000000..6de2c2b
--- /dev/null
+++ b/src/types/milliseconds.hpp
@@ -0,0 +1,5 @@
+#pragma once
+
+#include <chrono>
+
+using Milliseconds = std::chrono::duration<uint64_t, std::milli>;
diff --git a/src/operation_type.hpp b/src/types/operation_type.hpp
similarity index 100%
rename from src/operation_type.hpp
rename to src/types/operation_type.hpp
diff --git a/src/types/report_types.cpp b/src/types/report_types.cpp
new file mode 100644
index 0000000..f6979cc
--- /dev/null
+++ b/src/types/report_types.cpp
@@ -0,0 +1,26 @@
+#include "report_types.hpp"
+
+#include "utils/transform.hpp"
+
+ReadingParameters
+    toReadingParameters(const std::vector<LabeledMetricParameters>& labeled)
+{
+    namespace ts = utils::tstring;
+
+    return utils::transform(
+        labeled, [](const LabeledMetricParameters& metricParams) {
+            return ReadingParameters::value_type(
+                utils::transform(
+                    metricParams.at_label<ts::SensorPath>(),
+                    [](const LabeledSensorParameters& sensorParameters) {
+                        return sdbusplus::message::object_path(
+                            sensorParameters.at_label<ts::Path>());
+                    }),
+                utils::enumToString(metricParams.at_label<ts::OperationType>()),
+                metricParams.at_label<ts::Id>(),
+                metricParams.at_label<ts::MetricMetadata>(),
+                utils::enumToString(
+                    metricParams.at_label<ts::CollectionTimeScope>()),
+                metricParams.at_label<ts::CollectionDuration>().t.count());
+        });
+}
diff --git a/src/types/report_types.hpp b/src/types/report_types.hpp
new file mode 100644
index 0000000..8046df0
--- /dev/null
+++ b/src/types/report_types.hpp
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "types/collection_duration.hpp"
+#include "types/collection_time_scope.hpp"
+#include "types/operation_type.hpp"
+#include "utils/labeled_tuple.hpp"
+#include "utils/tstring.hpp"
+
+#include <sdbusplus/message/types.hpp>
+
+#include <chrono>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <vector>
+
+using ReadingParametersPastVersion =
+    std::vector<std::tuple<sdbusplus::message::object_path, std::string,
+                           std::string, std::string>>;
+
+using ReadingParameters = std::vector<
+    std::tuple<std::vector<sdbusplus::message::object_path>, std::string,
+               std::string, std::string, std::string, uint64_t>>;
+
+using LabeledSensorParameters =
+    utils::LabeledTuple<std::tuple<std::string, std::string>,
+                        utils::tstring::Service, utils::tstring::Path>;
+
+using LabeledMetricParameters = utils::LabeledTuple<
+    std::tuple<std::vector<LabeledSensorParameters>, OperationType, std::string,
+               std::string, CollectionTimeScope, CollectionDuration>,
+    utils::tstring::SensorPath, utils::tstring::OperationType,
+    utils::tstring::Id, utils::tstring::MetricMetadata,
+    utils::tstring::CollectionTimeScope, utils::tstring::CollectionDuration>;
+
+using Readings = std::tuple<
+    uint64_t,
+    std::vector<std::tuple<std::string, std::string, double, uint64_t>>>;
+
+ReadingParameters
+    toReadingParameters(const std::vector<LabeledMetricParameters>& labeled);
diff --git a/src/interfaces/trigger_types.hpp b/src/types/trigger_types.hpp
similarity index 100%
rename from src/interfaces/trigger_types.hpp
rename to src/types/trigger_types.hpp
diff --git a/src/utils/conversion_trigger.hpp b/src/utils/conversion_trigger.hpp
index 7ed660f..5229e5e 100644
--- a/src/utils/conversion_trigger.hpp
+++ b/src/utils/conversion_trigger.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
 #include "interfaces/json_storage.hpp"
-#include "interfaces/trigger_types.hpp"
+#include "types/trigger_types.hpp"
 
 namespace utils
 {
diff --git a/src/utils/detached_timer.hpp b/src/utils/detached_timer.hpp
index 224e5a1..636949c 100644
--- a/src/utils/detached_timer.hpp
+++ b/src/utils/detached_timer.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "types/milliseconds.hpp"
+
 #include <boost/asio/io_context.hpp>
 #include <boost/asio/steady_timer.hpp>
 
@@ -9,8 +11,8 @@
 {
 
 template <class F>
-void makeDetachedTimer(boost::asio::io_context& ioc,
-                       std::chrono::milliseconds delay, F&& fun)
+void makeDetachedTimer(boost::asio::io_context& ioc, Milliseconds delay,
+                       F&& fun)
 {
     auto timer = std::make_unique<boost::asio::steady_timer>(ioc);
     timer->expires_after(delay);
diff --git a/src/utils/json.hpp b/src/utils/json.hpp
new file mode 100644
index 0000000..2ae606f
--- /dev/null
+++ b/src/utils/json.hpp
@@ -0,0 +1,63 @@
+#pragma once
+
+#include <nlohmann/json.hpp>
+
+#include <string_view>
+
+namespace utils
+{
+
+template <class T>
+struct is_vector : std::false_type
+{};
+
+template <class T>
+struct is_vector<std::vector<T>> : std::true_type
+{};
+
+template <class T>
+constexpr bool is_vector_v = is_vector<T>::value;
+
+template <class T>
+std::optional<T> readJson(const nlohmann::json& json)
+{
+    if constexpr (is_vector_v<T>)
+    {
+        if (json.is_array())
+        {
+            auto result = T{};
+            for (const auto& item : json.items())
+            {
+                if (auto val = readJson<typename T::value_type>(item.value()))
+                {
+                    result.emplace_back(*val);
+                }
+            }
+            return result;
+        }
+    }
+    else
+    {
+        if (const T* val = json.get_ptr<const T*>())
+        {
+            return *val;
+        }
+    }
+
+    return std::nullopt;
+}
+
+template <class T>
+std::optional<T> readJson(const nlohmann::json& json, std::string_view key)
+{
+    auto it = json.find(key);
+    if (it != json.end())
+    {
+        const nlohmann::json& subJson = *it;
+        return readJson<T>(subJson);
+    }
+
+    return std::nullopt;
+}
+
+} // namespace utils
diff --git a/src/utils/labeled_tuple.hpp b/src/utils/labeled_tuple.hpp
index 795f37f..a224141 100644
--- a/src/utils/labeled_tuple.hpp
+++ b/src/utils/labeled_tuple.hpp
@@ -170,15 +170,15 @@
 };
 
 template <class... Args, class... Labels>
-void to_json(nlohmann::json& json,
-             const LabeledTuple<std::tuple<Args...>, Labels...>& tuple)
+inline void to_json(nlohmann::json& json,
+                    const LabeledTuple<std::tuple<Args...>, Labels...>& tuple)
 {
     json = tuple.to_json();
 }
 
 template <class... Args, class... Labels>
-void from_json(const nlohmann::json& json,
-               LabeledTuple<std::tuple<Args...>, Labels...>& tuple)
+inline void from_json(const nlohmann::json& json,
+                      LabeledTuple<std::tuple<Args...>, Labels...>& tuple)
 {
     tuple.from_json(json);
 }
diff --git a/src/utils/tstring.hpp b/src/utils/tstring.hpp
index 5b17d98..8f9701a 100644
--- a/src/utils/tstring.hpp
+++ b/src/utils/tstring.hpp
@@ -112,5 +112,21 @@
     }
 };
 
+struct CollectionTimeScope
+{
+    static std::string str()
+    {
+        return "collectionTimeScope";
+    }
+};
+
+struct CollectionDuration
+{
+    static std::string str()
+    {
+        return "collectionDuration";
+    }
+};
+
 } // namespace tstring
 } // namespace utils
diff --git a/tests/meson.build b/tests/meson.build
index e87a616..17cd369 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -25,6 +25,7 @@
             '../src/trigger_actions.cpp',
             '../src/trigger_factory.cpp',
             '../src/trigger_manager.cpp',
+            '../src/types/report_types.cpp',
             '../src/utils/conversion_trigger.cpp',
             'src/dbus_environment.cpp',
             'src/main.cpp',
diff --git a/tests/src/helpers.hpp b/tests/src/helpers.hpp
index 3cc6951..c12c610 100644
--- a/tests/src/helpers.hpp
+++ b/tests/src/helpers.hpp
@@ -1,7 +1,6 @@
 #pragma once
 
 #include "helpers/interfaces/json_storage_helpers.hpp"
-#include "helpers/interfaces/labeled_reading_parameter_helpers.hpp"
-#include "helpers/interfaces/labeled_sensor_parameter_helpers.hpp"
 #include "helpers/interfaces/sensor_id_helpers.hpp"
-#include "helpers/metric_value_helpers.hpp"
\ No newline at end of file
+#include "helpers/labeled_tuple_helpers.hpp"
+#include "helpers/metric_value_helpers.hpp"
diff --git a/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp b/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp
deleted file mode 100644
index 9a46d0c..0000000
--- a/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#pragma once
-
-#include "helpers/interfaces/labeled_sensor_parameter_helpers.hpp"
-#include "interfaces/types.hpp"
-
-#include <ostream>
-
-#include <gmock/gmock.h>
-
-namespace utils
-{
-
-inline void PrintTo(const LabeledMetricParameters& o, std::ostream* os)
-{
-    using testing::PrintToString;
-
-    (*os) << "{ ";
-    (*os) << utils::tstring::SensorPath::str() << ": "
-          << PrintToString(o.at_label<utils::tstring::SensorPath>()) << ", ";
-    (*os) << utils::tstring::OperationType::str() << ": "
-          << PrintToString(o.at_label<utils::tstring::OperationType>()) << ", ";
-    (*os) << utils::tstring::Id::str() << ": "
-          << PrintToString(o.at_label<utils::tstring::Id>()) << ", ";
-    (*os) << utils::tstring::MetricMetadata::str() << ": "
-          << PrintToString(o.at_label<utils::tstring::MetricMetadata>());
-    (*os) << " }";
-}
-
-} // namespace utils
diff --git a/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp b/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp
deleted file mode 100644
index ef2eb6b..0000000
--- a/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include "interfaces/types.hpp"
-
-#include <ostream>
-
-#include <gmock/gmock.h>
-
-namespace utils
-{
-
-inline void PrintTo(const LabeledSensorParameters& o, std::ostream* os)
-{
-    using testing::PrintToString;
-
-    (*os) << "{ ";
-    (*os) << utils::tstring::Service::str() << ": "
-          << PrintToString(o.at_label<utils::tstring::Service>()) << ", ";
-    (*os) << utils::tstring::Path::str() << ": "
-          << PrintToString(o.at_label<utils::tstring::Path>());
-    (*os) << " }";
-}
-
-} // namespace utils
\ No newline at end of file
diff --git a/tests/src/helpers/labeled_tuple_helpers.hpp b/tests/src/helpers/labeled_tuple_helpers.hpp
new file mode 100644
index 0000000..4ee70c1
--- /dev/null
+++ b/tests/src/helpers/labeled_tuple_helpers.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "utils/labeled_tuple.hpp"
+
+#include <iomanip>
+
+namespace utils
+{
+
+template <class... Args, class... Labels>
+inline void
+    PrintTo(const LabeledTuple<std::tuple<Args...>, Labels...>& labeledTuple,
+            std::ostream* os)
+{
+    nlohmann::json json;
+    to_json(json, labeledTuple);
+
+    (*os) << std::setw(2) << json;
+}
+
+} // namespace utils
diff --git a/tests/src/mocks/metric_mock.hpp b/tests/src/mocks/metric_mock.hpp
index 2f31f1e..98bad87 100644
--- a/tests/src/mocks/metric_mock.hpp
+++ b/tests/src/mocks/metric_mock.hpp
@@ -11,12 +11,13 @@
     {
         using namespace testing;
 
-        ON_CALL(*this, getReading())
-            .WillByDefault(ReturnRefOfCopy(MetricValue()));
+        ON_CALL(*this, getReadings())
+            .WillByDefault(ReturnRefOfCopy(std::vector<MetricValue>()));
     }
 
     MOCK_METHOD(void, initialize, (), (override));
-    MOCK_METHOD(const MetricValue&, getReading, (), (const, override));
+    MOCK_METHOD(const std::vector<MetricValue>&, getReadings, (),
+                (const, override));
     MOCK_METHOD(LabeledMetricParameters, dumpConfiguration, (),
                 (const, override));
 };
diff --git a/tests/src/mocks/report_factory_mock.hpp b/tests/src/mocks/report_factory_mock.hpp
index 0730d9e..a486e74 100644
--- a/tests/src/mocks/report_factory_mock.hpp
+++ b/tests/src/mocks/report_factory_mock.hpp
@@ -3,42 +3,56 @@
 #include "interfaces/report_factory.hpp"
 #include "mocks/report_mock.hpp"
 #include "params/report_params.hpp"
+#include "utils/transform.hpp"
 
 #include <gmock/gmock.h>
 
 class ReportFactoryMock : public interfaces::ReportFactory
 {
+    static std::vector<LabeledMetricParameters>
+        convertToLabeled(const ReadingParameters& readingParams)
+    {
+        return utils::transform(readingParams, [](const auto& params) {
+            return LabeledMetricParameters(
+                utils::transform(std::get<0>(params),
+                                 [](const auto& sensorPath) {
+                                     return LabeledSensorParameters("Service",
+                                                                    sensorPath);
+                                 }),
+                utils::stringToOperationType(std::get<1>(params)),
+                std::get<2>(params), std::get<3>(params),
+                utils::stringToCollectionTimeScope(std::get<4>(params)),
+                CollectionDuration(Milliseconds(std::get<5>(params))));
+        });
+    }
+
   public:
     ReportFactoryMock()
     {
         using namespace testing;
 
-        ON_CALL(*this,
-                make(A<boost::asio::yield_context&>(), _, _, _, _, _, _, _, _))
-            .WillByDefault(WithArgs<1>(Invoke([](const std::string& name) {
-                return std::make_unique<NiceMock<ReportMock>>(name);
-            })));
-        ON_CALL(*this, make(A<const std::string&>(), _, _, _, _, _, _, _, _))
+        ON_CALL(*this, convertMetricParams(_, _))
+            .WillByDefault(
+                WithArgs<1>(Invoke(&ReportFactoryMock::convertToLabeled)));
+
+        ON_CALL(*this, make(A<const std::string&>(), _, _, _, _, _, _, _))
             .WillByDefault(WithArgs<0>(Invoke([](const std::string& name) {
                 return std::make_unique<NiceMock<ReportMock>>(name);
             })));
     }
 
-    MOCK_METHOD(std::unique_ptr<interfaces::Report>, make,
-                (boost::asio::yield_context&, const std::string&,
-                 const std::string&, bool, bool, std::chrono::milliseconds,
-                 const ReadingParameters&, interfaces::ReportManager&,
-                 interfaces::JsonStorage&),
+    MOCK_METHOD(std::vector<LabeledMetricParameters>, convertMetricParams,
+                (boost::asio::yield_context&, const ReadingParameters&),
                 (const, override));
+
     MOCK_METHOD(std::unique_ptr<interfaces::Report>, make,
                 (const std::string&, const std::string&, bool, bool,
-                 std::chrono::milliseconds, const ReadingParameters&,
-                 interfaces::ReportManager&, interfaces::JsonStorage&,
+                 Milliseconds, interfaces::ReportManager&,
+                 interfaces::JsonStorage&,
                  std::vector<LabeledMetricParameters>),
                 (const, override));
 
     auto& expectMake(
-        const testing::Matcher<boost::asio::yield_context&>& yield,
         std::optional<std::reference_wrapper<const ReportParams>> paramsRef,
         const testing::Matcher<interfaces::ReportManager&>& rm,
         const testing::Matcher<interfaces::JsonStorage&>& js)
@@ -46,40 +60,17 @@
         if (paramsRef)
         {
             const ReportParams& params = *paramsRef;
-            return EXPECT_CALL(*this, make(yield, params.reportName(),
-                                           params.reportingType(),
-                                           params.emitReadingUpdate(),
-                                           params.logToMetricReportCollection(),
-                                           params.interval(),
-                                           params.readingParameters(), rm, js));
-        }
-        else
-        {
-            using testing::_;
-            return EXPECT_CALL(*this, make(yield, _, _, _, _, _, _, rm, js));
-        }
-    }
-
-    auto& expectMake(
-        std::optional<std::reference_wrapper<const ReportParams>> paramsRef,
-        const testing::Matcher<interfaces::ReportManager&>& rm,
-        const testing::Matcher<interfaces::JsonStorage&>& js,
-        const testing::Matcher<std::vector<LabeledMetricParameters>>& lrp)
-    {
-        if (paramsRef)
-        {
-            const ReportParams& params = *paramsRef;
             return EXPECT_CALL(*this,
                                make(params.reportName(), params.reportingType(),
                                     params.emitReadingUpdate(),
                                     params.logToMetricReportCollection(),
-                                    params.interval(),
-                                    params.readingParameters(), rm, js, lrp));
+                                    params.interval(), rm, js,
+                                    params.metricParameters()));
         }
         else
         {
             using testing::_;
-            return EXPECT_CALL(*this, make(_, _, _, _, _, _, rm, js, lrp));
+            return EXPECT_CALL(*this, make(_, _, _, _, _, rm, js, _));
         }
     }
 };
diff --git a/tests/src/params/metric_params.hpp b/tests/src/params/metric_params.hpp
new file mode 100644
index 0000000..f099472
--- /dev/null
+++ b/tests/src/params/metric_params.hpp
@@ -0,0 +1,74 @@
+#pragma once
+
+#include "types/collection_duration.hpp"
+#include "types/collection_time_scope.hpp"
+#include "types/operation_type.hpp"
+
+#include <string>
+
+class MetricParams final
+{
+  public:
+    MetricParams& operationType(OperationType val)
+    {
+        operationTypeProperty = val;
+        return *this;
+    }
+
+    const OperationType& operationType() const
+    {
+        return operationTypeProperty;
+    }
+
+    MetricParams& id(std::string val)
+    {
+        idProperty = std::move(val);
+        return *this;
+    }
+
+    const std::string& id() const
+    {
+        return idProperty;
+    }
+
+    MetricParams& metadata(std::string val)
+    {
+        metadataProperty = std::move(val);
+        return *this;
+    }
+
+    const std::string& metadata() const
+    {
+        return metadataProperty;
+    }
+
+    MetricParams& collectionTimeScope(CollectionTimeScope val)
+    {
+        collectionTimeScopeProperty = val;
+        return *this;
+    }
+
+    const CollectionTimeScope& collectionTimeScope() const
+    {
+        return collectionTimeScopeProperty;
+    }
+
+    MetricParams& collectionDuration(CollectionDuration val)
+    {
+        collectionDurationProperty = val;
+        return *this;
+    }
+
+    const CollectionDuration& collectionDuration() const
+    {
+        return collectionDurationProperty;
+    }
+
+  private:
+    OperationType operationTypeProperty = {};
+    std::string idProperty = "MetricId";
+    std::string metadataProperty = "MetricMetadata";
+    CollectionTimeScope collectionTimeScopeProperty = {};
+    CollectionDuration collectionDurationProperty =
+        CollectionDuration(Milliseconds(0u));
+};
diff --git a/tests/src/params/report_params.hpp b/tests/src/params/report_params.hpp
index 25422bc..3bfd308 100644
--- a/tests/src/params/report_params.hpp
+++ b/tests/src/params/report_params.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "interfaces/types.hpp"
 #include "report_manager.hpp"
+#include "types/report_types.hpp"
 
 #include <chrono>
 #include <string>
@@ -53,26 +53,26 @@
         return logToMetricReportCollectionProperty;
     }
 
-    ReportParams& interval(std::chrono::milliseconds val)
+    ReportParams& interval(Milliseconds val)
     {
         intervalProperty = val;
         return *this;
     }
 
-    std::chrono::milliseconds interval() const
+    Milliseconds interval() const
     {
         return intervalProperty;
     }
 
-    ReportParams& readingParameters(ReadingParameters val)
+    ReportParams& metricParameters(std::vector<LabeledMetricParameters> val)
     {
-        readingParametersProperty = std::move(val);
+        metricParametersProperty = std::move(val);
         return *this;
     }
 
-    const ReadingParameters& readingParameters() const
+    const std::vector<LabeledMetricParameters>& metricParameters() const
     {
-        return readingParametersProperty;
+        return metricParametersProperty;
     }
 
   private:
@@ -80,16 +80,22 @@
     std::string reportingTypeProperty = "OnRequest";
     bool emitReadingUpdateProperty = true;
     bool logToMetricReportCollectionProperty = true;
-    std::chrono::milliseconds intervalProperty = ReportManager::minInterval;
-    ReadingParameters readingParametersProperty = {
-        {{sdbusplus::message::object_path(
-             "/xyz/openbmc_project/sensors/power/p1")},
-         utils::enumToString(OperationType::single),
-         "MetricId1",
-         "Metadata1"},
-        {{sdbusplus::message::object_path(
-             "/xyz/openbmc_project/sensors/power/p2")},
-         utils::enumToString(OperationType::single),
-         "MetricId2",
-         "Metadata2"}};
+    Milliseconds intervalProperty = ReportManager::minInterval;
+    std::vector<LabeledMetricParameters> metricParametersProperty{
+        {LabeledMetricParameters{
+             {LabeledSensorParameters{"Service",
+                                      "/xyz/openbmc_project/sensors/power/p1"}},
+             OperationType::single,
+             "MetricId1",
+             "Metadata1",
+             CollectionTimeScope::point,
+             CollectionDuration(Milliseconds(0u))},
+         LabeledMetricParameters{
+             {LabeledSensorParameters{"Service",
+                                      "/xyz/openbmc_project/sensors/power/p2"}},
+             OperationType::single,
+             "MetricId2",
+             "Metadata2",
+             CollectionTimeScope::point,
+             CollectionDuration(Milliseconds(0u))}}};
 };
diff --git a/tests/src/params/trigger_params.hpp b/tests/src/params/trigger_params.hpp
index 7e00157..ac8656a 100644
--- a/tests/src/params/trigger_params.hpp
+++ b/tests/src/params/trigger_params.hpp
@@ -1,6 +1,7 @@
 #pragma once
 
-#include "interfaces/trigger_types.hpp"
+#include "types/milliseconds.hpp"
+#include "types/trigger_types.hpp"
 
 #include <sdbusplus/message.hpp>
 
@@ -88,12 +89,10 @@
 
     LabeledTriggerThresholdParams labeledThresholdsProperty =
         std::vector<numeric::LabeledThresholdParam>{
+            numeric::LabeledThresholdParam{numeric::Type::lowerCritical,
+                                           Milliseconds(10).count(),
+                                           numeric::Direction::decreasing, 0.5},
             numeric::LabeledThresholdParam{
-                numeric::Type::lowerCritical,
-                std::chrono::milliseconds(10).count(),
-                numeric::Direction::decreasing, 0.5},
-            numeric::LabeledThresholdParam{
-                numeric::Type::upperCritical,
-                std::chrono::milliseconds(10).count(),
+                numeric::Type::upperCritical, Milliseconds(10).count(),
                 numeric::Direction::increasing, 90.2}};
 };
diff --git a/tests/src/test_discrete_threshold.cpp b/tests/src/test_discrete_threshold.cpp
index 2b31767..47b6179 100644
--- a/tests/src/test_discrete_threshold.cpp
+++ b/tests/src/test_discrete_threshold.cpp
@@ -3,6 +3,7 @@
 #include "helpers.hpp"
 #include "mocks/sensor_mock.hpp"
 #include "mocks/trigger_action_mock.hpp"
+#include "types/milliseconds.hpp"
 #include "utils/conv_container.hpp"
 
 #include <gmock/gmock.h>
@@ -22,9 +23,8 @@
     TriggerActionMock& actionMock = *actionMockPtr;
     std::shared_ptr<DiscreteThreshold> sut;
 
-    std::shared_ptr<DiscreteThreshold>
-        makeThreshold(std::chrono::milliseconds dwellTime,
-                      double thresholdValue)
+    std::shared_ptr<DiscreteThreshold> makeThreshold(Milliseconds dwellTime,
+                                                     double thresholdValue)
     {
         std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
         actions.push_back(std::move(actionMockPtr));
@@ -68,10 +68,10 @@
         size_t sensor;
         uint64_t timestamp;
         double value;
-        std::chrono::milliseconds sleepAfter;
+        Milliseconds sleepAfter;
 
         UpdateParams(size_t sensor, uint64_t timestamp, double value,
-                     std::chrono::milliseconds sleepAfter = 0ms) :
+                     Milliseconds sleepAfter = 0ms) :
             sensor(sensor),
             timestamp(timestamp), value(value), sleepAfter(sleepAfter)
         {}
@@ -82,10 +82,10 @@
         size_t sensor;
         uint64_t timestamp;
         double value;
-        std::chrono::milliseconds waitMin;
+        Milliseconds waitMin;
 
         ExpectedParams(size_t sensor, uint64_t timestamp, double value,
-                       std::chrono::milliseconds waitMin = 0ms) :
+                       Milliseconds waitMin = 0ms) :
             sensor(sensor),
             timestamp(timestamp), value(value), waitMin(waitMin)
         {}
@@ -109,7 +109,7 @@
         return *this;
     }
 
-    DiscreteParams& DwellTime(std::chrono::milliseconds val)
+    DiscreteParams& DwellTime(Milliseconds val)
     {
         dwellTime = std::move(val);
         return *this;
@@ -139,7 +139,7 @@
     std::vector<UpdateParams> updates;
     std::vector<ExpectedParams> expected;
     double thresholdValue = 0.0;
-    std::chrono::milliseconds dwellTime = 0ms;
+    Milliseconds dwellTime = 0ms;
 };
 
 class TestDiscreteThresholdCommon :
@@ -147,7 +147,7 @@
     public WithParamInterface<DiscreteParams>
 {
   public:
-    void sleep(std::chrono::milliseconds duration)
+    void sleep(Milliseconds duration)
     {
         if (duration != 0ms)
         {
diff --git a/tests/src/test_metric.cpp b/tests/src/test_metric.cpp
index e91750d..9006962 100644
--- a/tests/src/test_metric.cpp
+++ b/tests/src/test_metric.cpp
@@ -1,6 +1,7 @@
 #include "helpers.hpp"
 #include "metric.hpp"
 #include "mocks/sensor_mock.hpp"
+#include "params/metric_params.hpp"
 #include "utils/conv_container.hpp"
 #include "utils/conversion.hpp"
 #include "utils/tstring.hpp"
@@ -8,6 +9,8 @@
 #include <gmock/gmock.h>
 
 using namespace testing;
+using namespace std::chrono_literals;
+
 namespace tstring = utils::tstring;
 
 using Timestamp = uint64_t;
@@ -15,16 +18,42 @@
 class TestMetric : public Test
 {
   public:
-    std::shared_ptr<SensorMock> sensorMock =
-        std::make_shared<NiceMock<SensorMock>>();
+    static std::vector<std::shared_ptr<SensorMock>>
+        makeSensorMocks(size_t amount)
+    {
+        std::vector<std::shared_ptr<SensorMock>> result;
+        for (size_t i = 0; i < amount; ++i)
+        {
+            result.emplace_back(std::make_shared<NiceMock<SensorMock>>());
+        }
+        return result;
+    }
 
-    std::shared_ptr<Metric> sut = std::make_shared<Metric>(
-        sensorMock, OperationType::avg, "id", "metadata");
+    std::shared_ptr<Metric> makeSut(const MetricParams& p)
+    {
+        return std::make_shared<Metric>(
+            utils::convContainer<std::shared_ptr<interfaces::Sensor>>(
+                sensorMocks),
+            p.operationType(), p.id(), p.metadata(), p.collectionTimeScope(),
+            p.collectionDuration());
+    }
+
+    MetricParams params =
+        MetricParams()
+            .id("id")
+            .metadata("metadata")
+            .operationType(OperationType::avg)
+            .collectionTimeScope(CollectionTimeScope::interval)
+            .collectionDuration(CollectionDuration(42ms));
+    std::vector<std::shared_ptr<SensorMock>> sensorMocks = makeSensorMocks(1u);
+    std::shared_ptr<Metric> sut;
 };
 
 TEST_F(TestMetric, subscribesForSensorDuringInitialization)
 {
-    EXPECT_CALL(*sensorMock,
+    sut = makeSut(params);
+
+    EXPECT_CALL(*sensorMocks.front(),
                 registerForUpdates(Truly([sut = sut.get()](const auto& a0) {
                     return a0.lock().get() == sut;
                 })));
@@ -34,29 +63,72 @@
 
 TEST_F(TestMetric, containsEmptyReadingAfterCreated)
 {
-    ASSERT_THAT(sut->getReading(), MetricValue({"id", "metadata", 0., 0u}));
+    sut = makeSut(params);
+
+    ASSERT_THAT(sut->getReadings(),
+                ElementsAre(MetricValue({"id", "metadata", 0., 0u})));
+}
+
+TEST_F(TestMetric, parsesSensorMetadata)
+{
+    nlohmann::json metadata;
+    metadata["MetricProperties"] = {"sensor1", "sensor2"};
+
+    sensorMocks = makeSensorMocks(2);
+    sut = makeSut(params.metadata(metadata.dump()));
+
+    EXPECT_THAT(sut->getReadings(),
+                ElementsAre(MetricValue{"id", "sensor1", 0., 0u},
+                            MetricValue{"id", "sensor2", 0., 0u}));
+}
+
+TEST_F(TestMetric, parsesSensorMetadataWhenMoreMetadataThanSensors)
+{
+    nlohmann::json metadata;
+    metadata["MetricProperties"] = {"sensor1", "sensor2"};
+
+    sensorMocks = makeSensorMocks(1);
+    sut = makeSut(params.metadata(metadata.dump()));
+
+    EXPECT_THAT(sut->getReadings(),
+                ElementsAre(MetricValue{"id", metadata.dump(), 0., 0u}));
+}
+
+TEST_F(TestMetric, parsesSensorMetadataWhenMoreSensorsThanMetadata)
+{
+    nlohmann::json metadata;
+    metadata["MetricProperties"] = {"sensor1"};
+
+    sensorMocks = makeSensorMocks(2);
+    sut = makeSut(params.metadata(metadata.dump()));
+
+    EXPECT_THAT(sut->getReadings(),
+                ElementsAre(MetricValue{"id", metadata.dump(), 0., 0u},
+                            MetricValue{"id", metadata.dump(), 0., 0u}));
 }
 
 class TestMetricAfterInitialization : public TestMetric
 {
   public:
-    TestMetricAfterInitialization()
+    void SetUp() override
     {
+        sut = makeSut(params);
         sut->initialize();
     }
 };
 
 TEST_F(TestMetricAfterInitialization, containsEmptyReading)
 {
-    ASSERT_THAT(sut->getReading(), MetricValue({"id", "metadata", 0., 0u}));
+    ASSERT_THAT(sut->getReadings(),
+                ElementsAre(MetricValue({"id", "metadata", 0., 0u})));
 }
 
 TEST_F(TestMetricAfterInitialization, updatesMetricValuesOnSensorUpdate)
 {
-    sut->sensorUpdated(*sensorMock, Timestamp{18}, 31.2);
+    sut->sensorUpdated(*sensorMocks.front(), Timestamp{18}, 31.2);
 
-    ASSERT_THAT(sut->getReading(),
-                Eq(MetricValue{"id", "metadata", 31.2, 18u}));
+    ASSERT_THAT(sut->getReadings(),
+                ElementsAre(MetricValue{"id", "metadata", 31.2, 18u}));
 }
 
 TEST_F(TestMetricAfterInitialization,
@@ -68,45 +140,24 @@
                  std::out_of_range);
 }
 
-TEST_F(TestMetricAfterInitialization, containsIdInConfigurationDump)
+TEST_F(TestMetricAfterInitialization, dumpsConfiguration)
 {
-    const auto conf = sut->dumpConfiguration();
+    namespace ts = utils::tstring;
 
-    EXPECT_THAT(conf.at_label<utils::tstring::Id>(), Eq("id"));
-    EXPECT_THAT(conf.to_json().at(tstring::Id::str()),
-                Eq(nlohmann::json("id")));
-}
-
-TEST_F(TestMetricAfterInitialization, containsOpInJsonDump)
-{
-    const auto conf = sut->dumpConfiguration();
-
-    EXPECT_THAT(conf.at_label<utils::tstring::OperationType>(),
-                Eq(OperationType::avg));
-    EXPECT_THAT(conf.to_json().at(tstring::OperationType::str()),
-                Eq(nlohmann::json(utils::toUnderlying(OperationType::avg))));
-}
-
-TEST_F(TestMetricAfterInitialization, containsMetadataInJsonDump)
-{
-    const auto conf = sut->dumpConfiguration();
-
-    EXPECT_THAT(conf.at_label<utils::tstring::MetricMetadata>(),
-                Eq("metadata"));
-    EXPECT_THAT(conf.to_json().at(tstring::MetricMetadata::str()),
-                Eq(nlohmann::json("metadata")));
-}
-
-TEST_F(TestMetricAfterInitialization, containsSensorPathInJsonDump)
-{
-    ON_CALL(*sensorMock, id())
+    ON_CALL(*sensorMocks.front(), id())
         .WillByDefault(Return(SensorMock::makeId("service1", "path1")));
 
     const auto conf = sut->dumpConfiguration();
 
-    EXPECT_THAT(conf.at_label<utils::tstring::SensorPath>(),
-                Eq(LabeledSensorParameters("service1", "path1")));
-    EXPECT_THAT(
-        conf.to_json().at(tstring::SensorPath::str()),
-        Eq(nlohmann::json({{"service", "service1"}, {"path", "path1"}})));
+    LabeledMetricParameters expected = {};
+    expected.at_label<ts::Id>() = "id";
+    expected.at_label<ts::MetricMetadata>() = "metadata";
+    expected.at_label<ts::OperationType>() = OperationType::avg;
+    expected.at_label<ts::CollectionTimeScope>() =
+        CollectionTimeScope::interval;
+    expected.at_label<ts::CollectionDuration>() = CollectionDuration(42ms);
+    expected.at_label<ts::SensorPath>() = {
+        LabeledSensorParameters("service1", "path1")};
+
+    EXPECT_THAT(conf, Eq(expected));
 }
diff --git a/tests/src/test_numeric_threshold.cpp b/tests/src/test_numeric_threshold.cpp
index 0f1d145..bda31a0 100644
--- a/tests/src/test_numeric_threshold.cpp
+++ b/tests/src/test_numeric_threshold.cpp
@@ -22,8 +22,8 @@
     TriggerActionMock& actionMock = *actionMockPtr;
     std::shared_ptr<NumericThreshold> sut;
 
-    void makeThreshold(std::chrono::milliseconds dwellTime,
-                       numeric::Direction direction, double thresholdValue)
+    void makeThreshold(Milliseconds dwellTime, numeric::Direction direction,
+                       double thresholdValue)
     {
         std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
         actions.push_back(std::move(actionMockPtr));
diff --git a/tests/src/test_report.cpp b/tests/src/test_report.cpp
index 80c0a9c..96f74f0 100644
--- a/tests/src/test_report.cpp
+++ b/tests/src/test_report.cpp
@@ -25,38 +25,30 @@
     std::unique_ptr<ReportManagerMock> reportManagerMock =
         std::make_unique<NiceMock<ReportManagerMock>>();
     testing::NiceMock<StorageMock> storageMock;
-    std::vector<std::shared_ptr<MetricMock>> metricMocks = {
-        std::make_shared<NiceMock<MetricMock>>(),
-        std::make_shared<NiceMock<MetricMock>>(),
-        std::make_shared<NiceMock<MetricMock>>()};
+    std::vector<std::shared_ptr<MetricMock>> metricMocks;
     std::unique_ptr<Report> sut;
 
     MockFunction<void()> checkPoint;
 
-    TestReport()
+    void initMetricMocks(
+        const std::vector<LabeledMetricParameters>& metricParameters)
     {
-        ON_CALL(*metricMocks[0], getReading())
-            .WillByDefault(ReturnRefOfCopy(MetricValue{"a", "b", 17.1, 114}));
-        ON_CALL(*metricMocks[1], getReading())
-            .WillByDefault(ReturnRefOfCopy(MetricValue{"aa", "bb", 42.0, 74}));
-        ON_CALL(*metricMocks[2], getReading())
-            .WillByDefault(
-                ReturnRefOfCopy(MetricValue{"aaa", "bbb", 100.7, 21}));
-
-        for (size_t i = 0; i < metricMocks.size(); ++i)
+        for (auto i = metricMocks.size(); i < metricParameters.size(); ++i)
         {
-            using namespace std::string_literals;
+            metricMocks.emplace_back(std::make_shared<NiceMock<MetricMock>>());
+        }
+        metricMocks.resize(metricParameters.size());
 
-            auto id = std::to_string(i);
+        std::vector<MetricValue> readings{{MetricValue{"a", "b", 17.1, 114},
+                                           MetricValue{"aa", "bb", 42.0, 74}}};
+        readings.resize(metricParameters.size());
 
-            auto sensorParameters =
-                LabeledSensorParameters("service"s + id, "path"s + id);
-            auto metricParameters = LabeledMetricParameters(
-                std::move(sensorParameters), utils::toOperationType(i),
-                "id"s + id, "metadata"s + id);
-
+        for (size_t i = 0; i < metricParameters.size(); ++i)
+        {
+            ON_CALL(*metricMocks[i], getReadings())
+                .WillByDefault(ReturnRefOfCopy(std::vector({readings[i]})));
             ON_CALL(*metricMocks[i], dumpConfiguration())
-                .WillByDefault(Return(std::move(metricParameters)));
+                .WillByDefault(Return(metricParameters[i]));
         }
     }
 
@@ -73,12 +65,13 @@
 
     std::unique_ptr<Report> makeReport(const ReportParams& params)
     {
+        initMetricMocks(params.metricParameters());
+
         return std::make_unique<Report>(
             DbusEnvironment::getIoc(), DbusEnvironment::getObjServer(),
             params.reportName(), params.reportingType(),
             params.emitReadingUpdate(), params.logToMetricReportCollection(),
-            params.interval(), params.readingParameters(), *reportManagerMock,
-            storageMock,
+            params.interval(), *reportManagerMock, storageMock,
             utils::convContainer<std::shared_ptr<interfaces::Metric>>(
                 metricMocks));
     }
@@ -126,7 +119,7 @@
                                                  const T& newValue)
     {
         auto setPromise = std::promise<boost::system::error_code>();
-        auto setFuture = setPromise.get_future();
+        auto future = setPromise.get_future();
         sdbusplus::asio::setProperty(
             *DbusEnvironment::getBus(), DbusEnvironment::serviceName(), path,
             Report::reportIfaceName, property, std::move(newValue),
@@ -134,7 +127,7 @@
                  std::move(setPromise)](boost::system::error_code ec) mutable {
                 setPromise.set_value(ec);
             });
-        return DbusEnvironment::waitForFuture(std::move(setFuture));
+        return DbusEnvironment::waitForFuture(std::move(future));
     }
 
     boost::system::error_code deleteReport(const std::string& path)
@@ -153,9 +146,9 @@
     EXPECT_THAT(
         getProperty<bool>(sut->getPath(), "LogToMetricReportsCollection"),
         Eq(defaultParams.logToMetricReportCollection()));
-    EXPECT_THAT(
-        getProperty<ReadingParameters>(sut->getPath(), "ReadingParameters"),
-        Eq(defaultParams.readingParameters()));
+    EXPECT_THAT(getProperty<ReadingParameters>(
+                    sut->getPath(), "ReadingParametersFutureVersion"),
+                Eq(toReadingParameters(defaultParams.metricParameters())));
 }
 
 TEST_F(TestReport, readingsAreInitialyEmpty)
@@ -247,7 +240,7 @@
 
 INSTANTIATE_TEST_SUITE_P(
     _, TestReportStore,
-    Values(std::make_pair("Version"s, nlohmann::json(3)),
+    Values(std::make_pair("Version"s, nlohmann::json(4)),
            std::make_pair("Name"s, nlohmann::json(ReportParams().reportName())),
            std::make_pair("ReportingType",
                           nlohmann::json(ReportParams().reportingType())),
@@ -262,20 +255,25 @@
                "ReadingParameters",
                nlohmann::json(
                    {{{tstring::SensorPath::str(),
-                      {{"service", "service0"}, {"path", "path0"}}},
+                      {{{tstring::Service::str(), "Service"},
+                        {tstring::Path::str(),
+                         "/xyz/openbmc_project/sensors/power/p1"}}}},
                      {tstring::OperationType::str(), OperationType::single},
-                     {tstring::Id::str(), "id0"},
-                     {tstring::MetricMetadata::str(), "metadata0"}},
+                     {tstring::Id::str(), "MetricId1"},
+                     {tstring::MetricMetadata::str(), "Metadata1"},
+                     {tstring::CollectionTimeScope::str(),
+                      CollectionTimeScope::point},
+                     {tstring::CollectionDuration::str(), 0}},
                     {{tstring::SensorPath::str(),
-                      {{"service", "service1"}, {"path", "path1"}}},
-                     {tstring::OperationType::str(), OperationType::max},
-                     {tstring::Id::str(), "id1"},
-                     {tstring::MetricMetadata::str(), "metadata1"}},
-                    {{tstring::SensorPath::str(),
-                      {{"service", "service2"}, {"path", "path2"}}},
-                     {tstring::OperationType::str(), OperationType::min},
-                     {tstring::Id::str(), "id2"},
-                     {tstring::MetricMetadata::str(), "metadata2"}}}))));
+                      {{{tstring::Service::str(), "Service"},
+                        {tstring::Path::str(),
+                         "/xyz/openbmc_project/sensors/power/p2"}}}},
+                     {tstring::OperationType::str(), OperationType::single},
+                     {tstring::Id::str(), "MetricId2"},
+                     {tstring::MetricMetadata::str(), "Metadata2"},
+                     {tstring::CollectionTimeScope::str(),
+                      CollectionTimeScope::point},
+                     {tstring::CollectionDuration::str(), 0}}}))));
 
 TEST_P(TestReportStore, settingPersistencyToTrueStoresReport)
 {
@@ -422,8 +420,7 @@
 
     EXPECT_THAT(readings,
                 ElementsAre(std::make_tuple("a"s, "b"s, 17.1, 114u),
-                            std::make_tuple("aa"s, "bb"s, 42.0, 74u),
-                            std::make_tuple("aaa"s, "bbb"s, 100.7, 21u)));
+                            std::make_tuple("aa"s, "bb"s, 42.0, 74u)));
 }
 
 class TestReportNonOnRequestType :
@@ -499,8 +496,7 @@
 
     EXPECT_THAT(readings,
                 ElementsAre(std::make_tuple("a"s, "b"s, 17.1, 114u),
-                            std::make_tuple("aa"s, "bb"s, 42.0, 74u),
-                            std::make_tuple("aaa"s, "bbb"s, 100.7, 21u)));
+                            std::make_tuple("aa"s, "bb"s, 42.0, 74u)));
 }
 
 class TestReportInitialization : public TestReport
diff --git a/tests/src/test_report_manager.cpp b/tests/src/test_report_manager.cpp
index 4ad5479..2287707 100644
--- a/tests/src/test_report_manager.cpp
+++ b/tests/src/test_report_manager.cpp
@@ -36,6 +36,9 @@
 
     void SetUp() override
     {
+        EXPECT_CALL(reportFactoryMock, convertMetricParams(_, _))
+            .Times(AnyNumber());
+
         sut = std::make_unique<ReportManager>(std::move(reportFactoryMockPtr),
                                               std::move(storageMockPtr),
                                               DbusEnvironment::getObjServer());
@@ -57,11 +60,11 @@
                 addReportPromise.set_value({ec, path});
             },
             DbusEnvironment::serviceName(), ReportManager::reportManagerPath,
-            ReportManager::reportManagerIfaceName, "AddReport",
+            ReportManager::reportManagerIfaceName, "AddReportFutureVersion",
             params.reportName(), params.reportingType(),
             params.emitReadingUpdate(), params.logToMetricReportCollection(),
-            static_cast<uint64_t>(params.interval().count()),
-            params.readingParameters());
+            params.interval().count(),
+            toReadingParameters(params.metricParameters()));
         return DbusEnvironment::waitForFuture(addReportPromise.get_future());
     }
 
@@ -74,10 +77,10 @@
             *DbusEnvironment::getBus(), DbusEnvironment::serviceName(),
             ReportManager::reportManagerPath,
             ReportManager::reportManagerIfaceName, property,
-            [&propertyPromise](boost::system::error_code ec, T t) {
+            [&propertyPromise](const boost::system::error_code& ec, T t) {
                 if (ec)
                 {
-                    utils::setException(propertyPromise, "GetProperty failed");
+                    utils::setException(propertyPromise, "Get property failed");
                     return;
                 }
                 propertyPromise.set_value(t);
@@ -99,7 +102,7 @@
 TEST_F(TestReportManager, minInterval)
 {
     EXPECT_THAT(getProperty<uint64_t>("MinInterval"),
-                Eq(static_cast<uint64_t>(ReportManager::minInterval.count())));
+                Eq(ReportManager::minInterval.count()));
 }
 
 TEST_F(TestReportManager, maxReports)
@@ -110,7 +113,8 @@
 
 TEST_F(TestReportManager, addReport)
 {
-    reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+    EXPECT_CALL(reportFactoryMock, convertMetricParams(_, _));
+    reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(reportMockPtr))));
 
     auto [ec, path] = addReport(reportParams);
@@ -123,7 +127,7 @@
     std::string reportName =
         prepareReportNameWithLength(ReportManager::maxReportNameLength);
     reportParams.reportName(reportName);
-    reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock));
+    reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock));
 
     auto [ec, path] = addReport(reportParams);
 
@@ -133,9 +137,7 @@
 
 TEST_F(TestReportManager, DISABLED_failToAddReportWithTooLongName)
 {
-    reportFactoryMock.expectMake(_, std::nullopt, Ref(*sut), Ref(storageMock))
-        .Times(0);
-    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock), _)
+    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock))
         .Times(0);
 
     reportParams.reportName(
@@ -149,7 +151,7 @@
 
 TEST_F(TestReportManager, DISABLED_failToAddReportTwice)
 {
-    reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+    reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(reportMockPtr))));
 
     addReport(reportParams);
@@ -162,9 +164,7 @@
 
 TEST_F(TestReportManager, DISABLED_failToAddReportWithInvalidInterval)
 {
-    reportFactoryMock.expectMake(_, std::nullopt, Ref(*sut), Ref(storageMock))
-        .Times(0);
-    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock), _)
+    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock))
         .Times(0);
 
     reportParams.reportingType("Periodic");
@@ -178,9 +178,7 @@
 
 TEST_F(TestReportManager, DISABLED_failToAddReportWithInvalidReportingType)
 {
-    reportFactoryMock.expectMake(_, std::nullopt, Ref(*sut), Ref(storageMock))
-        .Times(0);
-    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock), _)
+    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock))
         .Times(0);
 
     reportParams.reportingType("Invalid");
@@ -193,17 +191,15 @@
 
 TEST_F(TestReportManager, DISABLED_failToAddReportWithMoreSensorsThanExpected)
 {
-    reportFactoryMock.expectMake(_, std::nullopt, Ref(*sut), Ref(storageMock))
-        .Times(0);
-    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock), _)
+    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock))
         .Times(0);
 
-    auto readingParams = reportParams.readingParameters();
+    auto metricParams = reportParams.metricParameters();
     for (size_t i = 0; i < ReportManager::maxReadingParams + 1; i++)
     {
-        readingParams.push_back(readingParams.front());
+        metricParams.push_back(metricParams.front());
     }
-    reportParams.readingParameters(std::move(readingParams));
+    reportParams.metricParameters(std::move(metricParams));
 
     auto [ec, path] = addReport(reportParams);
 
@@ -213,7 +209,7 @@
 
 TEST_F(TestReportManager, DISABLED_failToAddReportWhenMaxReportIsReached)
 {
-    reportFactoryMock.expectMake(_, std::nullopt, Ref(*sut), Ref(storageMock))
+    reportFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock))
         .Times(ReportManager::maxReports);
 
     for (size_t i = 0; i < ReportManager::maxReports; i++)
@@ -236,8 +232,8 @@
 {
     {
         InSequence seq;
-        reportFactoryMock
-            .expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+        EXPECT_CALL(reportFactoryMock, convertMetricParams(_, _));
+        reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
             .WillOnce(Return(ByMove(std::move(reportMockPtr))));
         EXPECT_CALL(reportMock, Die());
         EXPECT_CALL(checkPoint, Call("end"));
@@ -264,8 +260,8 @@
 {
     {
         InSequence seq;
-        reportFactoryMock
-            .expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+        EXPECT_CALL(reportFactoryMock, convertMetricParams(_, _));
+        reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
             .WillOnce(Return(ByMove(std::move(reportMockPtr))));
         EXPECT_CALL(reportMock, Die());
         EXPECT_CALL(checkPoint, Call("end"));
@@ -279,7 +275,7 @@
 
 TEST_F(TestReportManager, updateReportCallsUpdateReadingsForExistReport)
 {
-    reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+    reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(reportMockPtr))));
     EXPECT_CALL(reportMock, updateReadings());
 
@@ -289,7 +285,7 @@
 
 TEST_F(TestReportManager, updateReportDoNothingIfReportDoesNotExist)
 {
-    reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+    reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(reportMockPtr))));
     EXPECT_CALL(reportMock, updateReadings()).Times(0);
 
@@ -313,14 +309,17 @@
 TEST_P(TestReportManagerWithAggregationOperationType,
        addReportWithDifferentOperationTypes)
 {
-    reportParams.readingParameters(
-        {{{sdbusplus::message::object_path(
-              "/xyz/openbmc_project/sensors/power/p1")},
-          utils::enumToString(operationType),
-          "MetricId1",
-          "Metadata1"}});
+    reportParams.metricParameters(
+        std::vector<LabeledMetricParameters>{{LabeledMetricParameters{
+            {LabeledSensorParameters{"Service",
+                                     "/xyz/openbmc_project/sensors/power/p1"}},
+            operationType,
+            "MetricId1",
+            "Metadata1",
+            CollectionTimeScope::point,
+            CollectionDuration(Milliseconds(0u))}}});
 
-    reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
+    reportFactoryMock.expectMake(reportParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(reportMockPtr))));
 
     auto [ec, path] = addReport(reportParams);
@@ -337,6 +336,8 @@
 
     void SetUp() override
     {
+        EXPECT_CALL(reportFactoryMock, convertMetricParams(_, _)).Times(0);
+
         ON_CALL(storageMock, list())
             .WillByDefault(Return(std::vector<FilePath>{FilePath("report1")}));
         ON_CALL(storageMock, load(FilePath("report1")))
@@ -350,17 +351,6 @@
                                               DbusEnvironment::getObjServer());
     }
 
-    static std::vector<LabeledMetricParameters>
-        convertToLabeled(const ReadingParameters& params)
-    {
-        return utils::transform(params, [](const auto& item) {
-            return LabeledMetricParameters(
-                LabeledSensorParameters("service", std::get<0>(item)),
-                utils::stringToOperationType(std::get<1>(item)),
-                std::get<2>(item), std::get<3>(item));
-        });
-    }
-
     nlohmann::json data = nlohmann::json{
         {"Version", Report::reportVersion},
         {"Name", reportParams.reportName()},
@@ -369,15 +359,12 @@
         {"LogToMetricReportsCollection",
          reportParams.logToMetricReportCollection()},
         {"Interval", reportParams.interval().count()},
-        {"ReadingParameters",
-         convertToLabeled(reportParams.readingParameters())}};
+        {"ReadingParameters", reportParams.metricParameters()}};
 };
 
 TEST_F(TestReportManagerStorage, reportManagerCtorAddReportFromStorage)
 {
-    reportFactoryMock.expectMake(
-        reportParams, _, Ref(storageMock),
-        ElementsAreArray(convertToLabeled(reportParams.readingParameters())));
+    reportFactoryMock.expectMake(reportParams, _, Ref(storageMock));
 
     makeReportManager();
 }
diff --git a/tests/src/test_trigger.cpp b/tests/src/test_trigger.cpp
index 2336267..7529017 100644
--- a/tests/src/test_trigger.cpp
+++ b/tests/src/test_trigger.cpp
@@ -27,10 +27,10 @@
             .thresholdParams(std::vector<discrete::LabeledThresholdParam>{
                 discrete::LabeledThresholdParam{
                     "userId", discrete::Severity::warning,
-                    std::chrono::milliseconds(10).count(), "15.2"},
+                    Milliseconds(10).count(), "15.2"},
                 discrete::LabeledThresholdParam{
                     "userId_2", discrete::Severity::critical,
-                    std::chrono::milliseconds(5).count(), "32.7"},
+                    Milliseconds(5).count(), "32.7"},
             });
 
     std::unique_ptr<TriggerManagerMock> triggerManagerMockPtr =
