Monitoring  3.3.4
O2 Monitoring library
o2::monitoring::backends::InfluxDB Class Referencefinal

Backend that sends metrics to InfluxDB time-series databse. More...

#include <InfluxDB.h>

Inheritance diagram for o2::monitoring::backends::InfluxDB:
Collaboration diagram for o2::monitoring::backends::InfluxDB:

Public Member Functions

 InfluxDB (std::unique_ptr< transports::TransportInterface > transport)
 
 ~InfluxDB ()=default
 Default destructor.
 
unsigned long convertTimestamp (const std::chrono::time_point< std::chrono::system_clock > &timestamp)
 
void send (const Metric &metric) override
 
void send (std::vector< Metric > &&metrics) override
 
void addGlobalTag (std::string_view name, std::string_view value) override
 
std::string toInfluxLineProtocol (const Metric &metric)
 
- Public Member Functions inherited from o2::monitoring::Backend
 Backend ()
 Default constructor.
 
virtual ~Backend ()=default
 Default destructor.
 
void setVerbosisty (Verbosity level)
 Set verbosity level.
 
Verbosity getVerbosity ()
 Get verbosity level.
 

Detailed Description

Backend that sends metrics to InfluxDB time-series databse.

Metrics are converted into Influx Line protocol and then sent via one of available transports

Constructor & Destructor Documentation

o2::monitoring::backends::InfluxDB::InfluxDB ( std::unique_ptr< transports::TransportInterface transport)

Constuctor

Parameters
transportAny available transport (udp, unix, kafka)

Member Function Documentation

void o2::monitoring::backends::InfluxDB::addGlobalTag ( std::string_view  name,
std::string_view  value 
)
overridevirtual

Adds tag

Parameters
nametag name
valuetag value

Implements o2::monitoring::Backend.

unsigned long o2::monitoring::backends::InfluxDB::convertTimestamp ( const std::chrono::time_point< std::chrono::system_clock > &  timestamp)
inline

Convert timestamp to unsigned long as required by InfluxDB

Parameters
timestampchrono time_point timestamp
Returns
timestamp in nanoseconds
void o2::monitoring::backends::InfluxDB::send ( const Metric metric)
overridevirtual

Sends metric to InfluxDB instance via one transport

Parameters
metricreference to metric object

Implements o2::monitoring::Backend.

void o2::monitoring::backends::InfluxDB::send ( std::vector< Metric > &&  metrics)
overridevirtual

Sends multiple metrics not related to each other @param metrics vector of metrics

Implements o2::monitoring::Backend.

std::string o2::monitoring::backends::InfluxDB::toInfluxLineProtocol ( const Metric metric)

Converts metric to Influx Line Protocol format

Parameters
metric

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