blob: 9448598ebc6710821d5b4f141a5b0443ff338428 [file] [log] [blame]
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +02001#pragma once
2
Wludzik, Jozefe2362792020-10-27 17:23:55 +01003#include "interfaces/json_storage.hpp"
Szymon Dompkefdb06a12022-02-11 11:04:44 +01004#include "interfaces/metric.hpp"
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +02005#include "interfaces/report.hpp"
6#include "interfaces/report_manager.hpp"
Krzysztof Grobelny493e62e2022-02-14 10:55:50 +01007#include "types/readings.hpp"
Krzysztof Grobelny51497a02021-11-09 14:56:22 +01008#include "types/report_action.hpp"
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +00009#include "types/report_types.hpp"
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010010#include "types/report_updates.hpp"
11#include "types/reporting_type.hpp"
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020012
Wludzik, Jozefe2362792020-10-27 17:23:55 +010013#include <boost/asio/spawn.hpp>
14
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020015#include <chrono>
16#include <memory>
Wludzik, Jozefe2362792020-10-27 17:23:55 +010017#include <optional>
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020018
19namespace interfaces
20{
21
22class ReportFactory
23{
24 public:
25 virtual ~ReportFactory() = default;
26
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000027 virtual std::vector<LabeledMetricParameters>
28 convertMetricParams(boost::asio::yield_context& yield,
29 const ReadingParameters& metricParams) const = 0;
Szymon Dompkefdb06a12022-02-11 11:04:44 +010030 virtual std::vector<LabeledMetricParameters>
31 convertMetricParams(const ReadingParameters& metricParams) const = 0;
32
Szymon Dompke32305f12022-07-05 15:37:21 +020033 virtual void updateMetrics(
34 std::vector<std::shared_ptr<interfaces::Metric>>& metrics, bool enabled,
35 const std::vector<LabeledMetricParameters>& labeledMetricParams)
36 const = 0;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000037
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +010038 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 Grobelny493e62e2022-02-14 10:55:50 +010046 bool enabled, Readings) const = 0;
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020047};
48
49} // namespace interfaces