16 #ifndef ALICEO2_MONITORING_MONITORING_H 17 #define ALICEO2_MONITORING_MONITORING_H 26 #include <unordered_map> 59 void addBackend(std::unique_ptr<Backend> backend);
84 void addGlobalTag(std::string_view name, std::string_view value);
99 void transmit(std::vector<Metric>&& metrics);
109 std::unique_ptr<DerivedMetrics> mDerivedHandler;
112 std::vector<std::unique_ptr<Backend>> mBackends;
115 void transmit(
Metric&& metric);
118 std::atomic<bool> mMonitorRunning;
121 std::thread mMonitorThread;
124 std::unique_ptr<ProcessMonitor> mProcessMonitor;
130 std::unordered_map<std::underlying_type<Verbosity>::type, std::vector<Metric>> mStorage;
136 std::size_t mBufferSize;
142 std::atomic<unsigned int> mProcessMonitoringInterval;
151 #endif // ALICEO2_MONITORING_MONITORING_H void addBackend(std::unique_ptr< Backend > backend)
Creates and appends backend to the backend list.
Definition: Monitoring.cxx:113
void enableBuffering(const std::size_t size=128)
Definition: Monitoring.cxx:46
Verbosity
Metric and Backedn verbosity.
Definition: Metric.h:24
DerivedMetricMode
Available derived metric modes.
Definition: DerivedMetrics.h:33
void enableProcessMonitoring(const unsigned int interval=5)
Definition: Monitoring.cxx:82
~Monitoring()
Joins process monitor thread if possible.
Definition: Monitoring.cxx:120
Main class that collects metrics from user and dispatches them to selected monitoring backends...
Definition: Monitoring.h:46
void flushBuffer()
Flushes metric buffer (this can also happen when buffer is full)
Definition: Monitoring.cxx:56
Represents a metric including value, type of the value, name, timestamp and tags. ...
Definition: Metric.h:37
void addGlobalTag(std::string_view name, std::string_view value)
Definition: Monitoring.cxx:97
Monitoring & operator=(const Monitoring &)=delete
Disable copy constructor.
Monitoring()
Instantiates derived metrics processor (see DerivedMetrics) and process monitor (seeProcessMonitor).
Definition: Monitoring.cxx:36
void send(Metric &&metric, DerivedMetricMode mode=DerivedMetricMode::NONE)
Definition: Monitoring.cxx:169