Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 1 | #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 | |
| 17 | using ReadingParametersPastVersion = |
| 18 | std::vector<std::tuple<sdbusplus::message::object_path, std::string, |
| 19 | std::string, std::string>>; |
| 20 | |
Krzysztof Grobelny | b8cc78d | 2021-11-29 15:54:53 +0100 | [diff] [blame] | 21 | using 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 Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 24 | |
| 25 | using LabeledSensorParameters = |
Krzysztof Grobelny | b8cc78d | 2021-11-29 15:54:53 +0100 | [diff] [blame] | 26 | utils::LabeledTuple<std::tuple<std::string, std::string, std::string>, |
| 27 | utils::tstring::Service, utils::tstring::Path, |
| 28 | utils::tstring::Metadata>; |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 29 | |
| 30 | using LabeledMetricParameters = utils::LabeledTuple< |
| 31 | std::tuple<std::vector<LabeledSensorParameters>, OperationType, std::string, |
Krzysztof Grobelny | b8cc78d | 2021-11-29 15:54:53 +0100 | [diff] [blame] | 32 | CollectionTimeScope, CollectionDuration>, |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 33 | utils::tstring::SensorPath, utils::tstring::OperationType, |
Krzysztof Grobelny | b8cc78d | 2021-11-29 15:54:53 +0100 | [diff] [blame] | 34 | utils::tstring::Id, utils::tstring::CollectionTimeScope, |
| 35 | utils::tstring::CollectionDuration>; |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 36 | |
Szymon Dompke | 3eb5686 | 2021-09-20 15:32:04 +0200 | [diff] [blame] | 37 | using ReadingData = std::tuple<std::string, std::string, double, uint64_t>; |
| 38 | |
| 39 | using Readings = std::tuple<uint64_t, std::vector<ReadingData>>; |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 40 | |
| 41 | ReadingParameters |
| 42 | toReadingParameters(const std::vector<LabeledMetricParameters>& labeled); |