blob: 63f4cf73e650cdcd79fba80b7caa5274c1bb5b89 [file] [log] [blame]
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +02001#pragma once
2
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +01003#include "interfaces/metric_listener.hpp"
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +02004#include "metric_value.hpp"
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +01005#include "types/duration_types.hpp"
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +00006#include "types/report_types.hpp"
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +02007
Wludzik, Jozefe2362792020-10-27 17:23:55 +01008#include <nlohmann/json.hpp>
9
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020010#include <vector>
11
12namespace interfaces
13{
14
15class Metric
16{
17 public:
18 virtual ~Metric() = default;
19
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +010020 virtual void initialize() = 0;
Lukasz Kazmierczak7e098e92021-09-16 15:59:56 +020021 virtual void deinitialize() = 0;
Krzysztof Grobelny9e8da542022-02-17 10:40:16 +010022 virtual const std::vector<MetricValue>& getUpdatedReadings() = 0;
Krzysztof Grobelnyd2238192020-12-02 09:27:28 +000023 virtual LabeledMetricParameters dumpConfiguration() const = 0;
Krzysztof Grobelny18e71012022-11-02 13:17:01 +000024 virtual uint64_t metricCount() const = 0;
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +010025 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 Grobelnyc8e3a642020-10-23 12:29:16 +020030};
31
32} // namespace interfaces