Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Wludzik, Jozef | e236279 | 2020-10-27 17:23:55 +0100 | [diff] [blame] | 3 | #include "interfaces/json_storage.hpp" |
Szymon Dompke | fdb06a1 | 2022-02-11 11:04:44 +0100 | [diff] [blame] | 4 | #include "interfaces/metric.hpp" |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 5 | #include "interfaces/report.hpp" |
| 6 | #include "interfaces/report_manager.hpp" |
Krzysztof Grobelny | 493e62e | 2022-02-14 10:55:50 +0100 | [diff] [blame] | 7 | #include "types/readings.hpp" |
Krzysztof Grobelny | 51497a0 | 2021-11-09 14:56:22 +0100 | [diff] [blame] | 8 | #include "types/report_action.hpp" |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 9 | #include "types/report_types.hpp" |
Krzysztof Grobelny | 51497a0 | 2021-11-09 14:56:22 +0100 | [diff] [blame] | 10 | #include "types/report_updates.hpp" |
| 11 | #include "types/reporting_type.hpp" |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 12 | |
Wludzik, Jozef | e236279 | 2020-10-27 17:23:55 +0100 | [diff] [blame] | 13 | #include <boost/asio/spawn.hpp> |
| 14 | |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 15 | #include <chrono> |
| 16 | #include <memory> |
Wludzik, Jozef | e236279 | 2020-10-27 17:23:55 +0100 | [diff] [blame] | 17 | #include <optional> |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 18 | |
| 19 | namespace interfaces |
| 20 | { |
| 21 | |
| 22 | class ReportFactory |
| 23 | { |
| 24 | public: |
| 25 | virtual ~ReportFactory() = default; |
| 26 | |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 27 | virtual std::vector<LabeledMetricParameters> |
| 28 | convertMetricParams(boost::asio::yield_context& yield, |
| 29 | const ReadingParameters& metricParams) const = 0; |
Szymon Dompke | fdb06a1 | 2022-02-11 11:04:44 +0100 | [diff] [blame] | 30 | virtual std::vector<LabeledMetricParameters> |
| 31 | convertMetricParams(const ReadingParameters& metricParams) const = 0; |
| 32 | |
Szymon Dompke | 32305f1 | 2022-07-05 15:37:21 +0200 | [diff] [blame] | 33 | virtual void updateMetrics( |
| 34 | std::vector<std::shared_ptr<interfaces::Metric>>& metrics, bool enabled, |
| 35 | const std::vector<LabeledMetricParameters>& labeledMetricParams) |
| 36 | const = 0; |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 37 | |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 38 | virtual std::unique_ptr<interfaces::Report> |
| 39 | make(const std::string& id, const std::string& name, |
| 40 | const ReportingType reportingType, |
| 41 | const std::vector<ReportAction>& reportActions, |
| 42 | Milliseconds period, uint64_t appendLimit, |
| 43 | const ReportUpdates reportUpdates, ReportManager& reportManager, |
| 44 | JsonStorage& reportStorage, |
| 45 | std::vector<LabeledMetricParameters> labeledMetricParams, |
Krzysztof Grobelny | 493e62e | 2022-02-14 10:55:50 +0100 | [diff] [blame] | 46 | bool enabled, Readings) const = 0; |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace interfaces |