Monitoring  3.3.4
O2 Monitoring library
o2::monitoring::Monitoring Class Reference

Main class that collects metrics from user and dispatches them to selected monitoring backends. More...

#include <Monitoring.h>

Collaboration diagram for o2::monitoring::Monitoring:

Public Member Functions

Monitoringoperator= (const Monitoring &)=delete
 Disable copy constructor.
 
 Monitoring (const Monitoring &)=delete
 Disable copy constructor.
 
 Monitoring ()
 Instantiates derived metrics processor (see DerivedMetrics) and process monitor (seeProcessMonitor).
 
void addBackend (std::unique_ptr< Backend > backend)
 Creates and appends backend to the backend list.
 
 ~Monitoring ()
 Joins process monitor thread if possible.
 
void send (Metric &&metric, DerivedMetricMode mode=DerivedMetricMode::NONE)
 
void enableProcessMonitoring (const unsigned int interval=5)
 
void flushBuffer ()
 Flushes metric buffer (this can also happen when buffer is full)
 
void enableBuffering (const std::size_t size=128)
 
void addGlobalTag (std::string_view name, std::string_view value)
 
void addGlobalTag (tags::Key key, tags::Value value)
 

Detailed Description

Main class that collects metrics from user and dispatches them to selected monitoring backends.

Collects user-defined metrics (seeMetric class) and pushes them through all selected backends (seeBackend). Calculates derived metrics such as rate and increment value (seeDerivedMetrics class). Adds default tags to each metric: proces name, hostname (seeProcessDetails class) Monitors the process itself - including memory, cpu and network usage (seeProcessMonitor class).

Member Function Documentation

void o2::monitoring::Monitoring::addGlobalTag ( std::string_view  name,
std::string_view  value 
)

Adds global tag

Parameters
nametag name
valuetag value
void o2::monitoring::Monitoring::addGlobalTag ( tags::Key  key,
tags::Value  value 
)

Adds global tag

Parameters
nametag name
valuetag value
void o2::monitoring::Monitoring::enableBuffering ( const std::size_t  size = 128)

Enables metric buffering

Parameters
sizebuffer size
void o2::monitoring::Monitoring::enableProcessMonitoring ( const unsigned int  interval = 5)

Enables process monitoring

Parameters
intervalrefresh interval
void o2::monitoring::Monitoring::send ( Metric &&  metric,
DerivedMetricMode  mode = DerivedMetricMode::NONE 
)

Sends a metric to all avaliabes backends If DerivedMetricMode is specified it generates and sends derived metric

Parameters
metricr-value to metric object
modeDerived metric mode

The documentation for this class was generated from the following files: