blob: 49dca7372f2163995ce206914ef45118519849ab [file] [log] [blame]
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +00001#pragma once
2
3#include "types/collection_duration.hpp"
4#include "types/collection_time_scope.hpp"
5#include "types/operation_type.hpp"
Szymon Dompke94f71c52021-12-10 07:16:33 +01006#include "types/sensor_types.hpp"
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +00007#include "utils/labeled_tuple.hpp"
8#include "utils/tstring.hpp"
9
10#include <sdbusplus/message/types.hpp>
11
12#include <chrono>
13#include <string>
14#include <tuple>
15#include <type_traits>
Krzysztof Grobelnya8182be2022-07-04 11:26:20 +020016#include <variant>
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000017#include <vector>
18
19using ReadingParametersPastVersion =
20 std::vector<std::tuple<sdbusplus::message::object_path, std::string,
21 std::string, std::string>>;
22
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010023using ReadingParameters = std::vector<std::tuple<
24 std::vector<std::tuple<sdbusplus::message::object_path, std::string>>,
25 std::string, std::string, std::string, uint64_t>>;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000026
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000027using LabeledMetricParameters = utils::LabeledTuple<
Szymon Dompke94f71c52021-12-10 07:16:33 +010028 std::tuple<std::vector<LabeledSensorInfo>, OperationType, std::string,
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010029 CollectionTimeScope, CollectionDuration>,
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000030 utils::tstring::SensorPath, utils::tstring::OperationType,
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010031 utils::tstring::Id, utils::tstring::CollectionTimeScope,
32 utils::tstring::CollectionDuration>;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000033
Krzysztof Grobelnya8182be2022-07-04 11:26:20 +020034using AddReportFutureVersionVariant =
35 std::variant<std::monostate, bool, uint64_t, std::string,
36 std::vector<std::string>, ReadingParameters>;
37
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000038ReadingParameters
39 toReadingParameters(const std::vector<LabeledMetricParameters>& labeled);