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