blob: e1f9f2a19f669205efa08190eeb62f40fa9feeea [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 Grobelny51497a02021-11-09 14:56:22 +01007#include "types/report_action.hpp"
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +00008#include "types/report_types.hpp"
Krzysztof Grobelny51497a02021-11-09 14:56:22 +01009#include "types/report_updates.hpp"
10#include "types/reporting_type.hpp"
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020011
Wludzik, Jozefe2362792020-10-27 17:23:55 +010012#include <boost/asio/spawn.hpp>
13
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020014#include <chrono>
15#include <memory>
Wludzik, Jozefe2362792020-10-27 17:23:55 +010016#include <optional>
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020017
18namespace interfaces
19{
20
21class ReportFactory
22{
23 public:
24 virtual ~ReportFactory() = default;
25
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000026 virtual std::vector<LabeledMetricParameters>
27 convertMetricParams(boost::asio::yield_context& yield,
28 const ReadingParameters& metricParams) const = 0;
Szymon Dompkefdb06a12022-02-11 11:04:44 +010029 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 Grobelnydcc4e192021-03-08 09:09:34 +000036
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +010037 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, Jozef2f9f9b82020-10-13 09:07:45 +020046};
47
48} // namespace interfaces