blob: 978fd18ca3bda74367d75be478bb7d3b88cdaef9 [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"
6#include "utils/labeled_tuple.hpp"
7#include "utils/tstring.hpp"
8
9#include <sdbusplus/message/types.hpp>
10
11#include <chrono>
12#include <string>
13#include <tuple>
14#include <type_traits>
15#include <vector>
16
17using ReadingParametersPastVersion =
18 std::vector<std::tuple<sdbusplus::message::object_path, std::string,
19 std::string, std::string>>;
20
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010021using ReadingParameters = std::vector<std::tuple<
22 std::vector<std::tuple<sdbusplus::message::object_path, std::string>>,
23 std::string, std::string, std::string, uint64_t>>;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000024
25using LabeledSensorParameters =
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010026 utils::LabeledTuple<std::tuple<std::string, std::string, std::string>,
27 utils::tstring::Service, utils::tstring::Path,
28 utils::tstring::Metadata>;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000029
30using LabeledMetricParameters = utils::LabeledTuple<
31 std::tuple<std::vector<LabeledSensorParameters>, OperationType, std::string,
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010032 CollectionTimeScope, CollectionDuration>,
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000033 utils::tstring::SensorPath, utils::tstring::OperationType,
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010034 utils::tstring::Id, utils::tstring::CollectionTimeScope,
35 utils::tstring::CollectionDuration>;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000036
Szymon Dompke3eb56862021-09-20 15:32:04 +020037using ReadingData = std::tuple<std::string, std::string, double, uint64_t>;
38
39using Readings = std::tuple<uint64_t, std::vector<ReadingData>>;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000040
41ReadingParameters
42 toReadingParameters(const std::vector<LabeledMetricParameters>& labeled);