Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Krzysztof Grobelny | f7ea299 | 2022-01-27 11:04:58 +0100 | [diff] [blame] | 3 | #include "interfaces/metric_listener.hpp" |
Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame] | 4 | #include "metric_value.hpp" |
Krzysztof Grobelny | f7ea299 | 2022-01-27 11:04:58 +0100 | [diff] [blame] | 5 | #include "types/duration_types.hpp" |
Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 6 | #include "types/report_types.hpp" |
Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame] | 7 | |
Wludzik, Jozef | e236279 | 2020-10-27 17:23:55 +0100 | [diff] [blame] | 8 | #include <nlohmann/json.hpp> |
| 9 | |
Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame] | 10 | #include <vector> |
| 11 | |
| 12 | namespace interfaces |
| 13 | { |
| 14 | |
| 15 | class Metric |
| 16 | { |
| 17 | public: |
| 18 | virtual ~Metric() = default; |
| 19 | |
Krzysztof Grobelny | 6ccfcbf | 2020-11-04 09:31:36 +0100 | [diff] [blame] | 20 | virtual void initialize() = 0; |
Lukasz Kazmierczak | 7e098e9 | 2021-09-16 15:59:56 +0200 | [diff] [blame] | 21 | virtual void deinitialize() = 0; |
Krzysztof Grobelny | 9e8da54 | 2022-02-17 10:40:16 +0100 | [diff] [blame] | 22 | virtual const std::vector<MetricValue>& getUpdatedReadings() = 0; |
Krzysztof Grobelny | d223819 | 2020-12-02 09:27:28 +0000 | [diff] [blame] | 23 | virtual LabeledMetricParameters dumpConfiguration() const = 0; |
Krzysztof Grobelny | 18e7101 | 2022-11-02 13:17:01 +0000 | [diff] [blame] | 24 | virtual uint64_t metricCount() const = 0; |
Krzysztof Grobelny | f7ea299 | 2022-01-27 11:04:58 +0100 | [diff] [blame] | 25 | virtual void registerForUpdates(interfaces::MetricListener& listener) = 0; |
| 26 | virtual void |
| 27 | unregisterFromUpdates(interfaces::MetricListener& listener) = 0; |
| 28 | virtual void updateReadings(Milliseconds) = 0; |
| 29 | virtual bool isTimerRequired() const = 0; |
Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | } // namespace interfaces |