xref: /openbmc/telemetry/src/interfaces/metric.hpp (revision 18e7101c)
1c8e3a64aSKrzysztof Grobelny #pragma once
2c8e3a64aSKrzysztof Grobelny 
3f7ea2997SKrzysztof Grobelny #include "interfaces/metric_listener.hpp"
4c8e3a64aSKrzysztof Grobelny #include "metric_value.hpp"
5f7ea2997SKrzysztof Grobelny #include "types/duration_types.hpp"
6dcc4e193SKrzysztof Grobelny #include "types/report_types.hpp"
7c8e3a64aSKrzysztof Grobelny 
8e2362796SWludzik, Jozef #include <nlohmann/json.hpp>
9e2362796SWludzik, Jozef 
10c8e3a64aSKrzysztof Grobelny #include <vector>
11c8e3a64aSKrzysztof Grobelny 
12c8e3a64aSKrzysztof Grobelny namespace interfaces
13c8e3a64aSKrzysztof Grobelny {
14c8e3a64aSKrzysztof Grobelny 
15c8e3a64aSKrzysztof Grobelny class Metric
16c8e3a64aSKrzysztof Grobelny {
17c8e3a64aSKrzysztof Grobelny   public:
18c8e3a64aSKrzysztof Grobelny     virtual ~Metric() = default;
19c8e3a64aSKrzysztof Grobelny 
206ccfcbf5SKrzysztof Grobelny     virtual void initialize() = 0;
217e098e93SLukasz Kazmierczak     virtual void deinitialize() = 0;
229e8da546SKrzysztof Grobelny     virtual const std::vector<MetricValue>& getUpdatedReadings() = 0;
23d2238194SKrzysztof Grobelny     virtual LabeledMetricParameters dumpConfiguration() const = 0;
24*18e7101cSKrzysztof Grobelny     virtual uint64_t metricCount() const = 0;
25f7ea2997SKrzysztof Grobelny     virtual void registerForUpdates(interfaces::MetricListener& listener) = 0;
26f7ea2997SKrzysztof Grobelny     virtual void
27f7ea2997SKrzysztof Grobelny         unregisterFromUpdates(interfaces::MetricListener& listener) = 0;
28f7ea2997SKrzysztof Grobelny     virtual void updateReadings(Milliseconds) = 0;
29f7ea2997SKrzysztof Grobelny     virtual bool isTimerRequired() const = 0;
30c8e3a64aSKrzysztof Grobelny };
31c8e3a64aSKrzysztof Grobelny 
32c8e3a64aSKrzysztof Grobelny } // namespace interfaces
33