CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
perf::TelemetryAggregatorInflux Class Reference

#include <telemetry_aggregator_influx.h>

Inheritance diagram for perf::TelemetryAggregatorInflux:
Collaboration diagram for perf::TelemetryAggregatorInflux:

Public Member Functions

 TelemetryAggregatorInflux (Statistics *statistics, int send_rate_sec, OptionsManager *options_mgr, const std::string &fqrn)
 
virtual ~TelemetryAggregatorInflux ()
 

Private Member Functions

 FRIEND_TEST (T_TelemetryAggregator, EmptyCounters)
 
 FRIEND_TEST (T_TelemetryAggregator, FailCreate)
 
 FRIEND_TEST (T_TelemetryAggregator, ExtraFields_Tags)
 
 FRIEND_TEST (T_TelemetryAggregator, UpdateCounters_WithExtraFields_Tags)
 
std::string MakePayload ()
 
std::string MakeDeltaPayload ()
 
TelemetryReturn OpenSocket ()
 
TelemetryReturn SendToInflux (const std::string &payload)
 
virtual void PushMetrics ()
 
- Private Member Functions inherited from perf::TelemetryAggregator
virtual ~TelemetryAggregator ()
 
void Spawn ()
 
 TelemetryAggregator (Statistics *statistics, int send_rate_sec, const std::string &fqrn)
 

Private Attributes

std::map< std::string, int64_t > old_counters_
 
std::string influx_host_
 
int influx_port_
 
std::string influx_metric_name_
 
std::string influx_extra_fields_
 
std::string influx_extra_tags_
 
int socket_fd_
 
struct addrinfo * res_
 
- Private Attributes inherited from perf::TelemetryAggregator
Statisticsstatistics_
 
const int send_rate_sec_
 
int pipe_terminate_ [2]
 
pthread_t thread_telemetry_
 
std::string fqrn_
 
bool is_zombie_
 
uint64_t timestamp_
 
std::map< std::string, int64_t > counters_
 

Additional Inherited Members

- Static Private Member Functions inherited from perf::TelemetryAggregator
static TelemetryAggregatorCreate (Statistics *statistics, int send_rate, OptionsManager *options_mgr, const std::string &fqrn, const TelemetrySelector type)
 
static void * MainTelemetry (void *data)
 

Detailed Description

Definition at line 25 of file telemetry_aggregator_influx.h.

Constructor & Destructor Documentation

perf::TelemetryAggregatorInflux::TelemetryAggregatorInflux ( Statistics statistics,
int  send_rate_sec,
OptionsManager options_mgr,
const std::string &  fqrn 
)

Definition at line 24 of file telemetry_aggregator_influx.cc.

Here is the call graph for this function:

perf::TelemetryAggregatorInflux::~TelemetryAggregatorInflux ( )
virtual

Definition at line 91 of file telemetry_aggregator_influx.cc.

Member Function Documentation

perf::TelemetryAggregatorInflux::FRIEND_TEST ( T_TelemetryAggregator  ,
EmptyCounters   
)
private
perf::TelemetryAggregatorInflux::FRIEND_TEST ( T_TelemetryAggregator  ,
FailCreate   
)
private
perf::TelemetryAggregatorInflux::FRIEND_TEST ( T_TelemetryAggregator  ,
ExtraFields_Tags   
)
private
perf::TelemetryAggregatorInflux::FRIEND_TEST ( T_TelemetryAggregator  ,
UpdateCounters_WithExtraFields_Tags   
)
private
std::string perf::TelemetryAggregatorInflux::MakeDeltaPayload ( )
private

Creates a string in the influx data format containing the delta between 2 measurements of the same counter. Counters are only included if their absolute value is > 0 (delta can be 0).

NOTE: As influx_extra_fields_ are static, they are excluded of this delta format

Influx dataformat ( https://docs.influxdata.com/influxdb/cloud/reference/syntax/line-protocol/ ) Syntax <measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]] <field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]

Example myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue" 1556813561098000000

Definition at line 166 of file telemetry_aggregator_influx.cc.

Referenced by PushMetrics().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string perf::TelemetryAggregatorInflux::MakePayload ( )
private

Creates a string in the influx data format containing the absolute values of the counters. Counters are only included if their absolute value is > 0.

Influx dataformat ( https://docs.influxdata.com/influxdb/cloud/reference/syntax/line-protocol/ ) Syntax <measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]] <field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]

Example myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue" 1556813561098000000

Definition at line 112 of file telemetry_aggregator_influx.cc.

Referenced by PushMetrics().

Here is the call graph for this function:

Here is the caller graph for this function:

TelemetryReturn perf::TelemetryAggregatorInflux::OpenSocket ( )
private

Definition at line 199 of file telemetry_aggregator_influx.cc.

Referenced by TelemetryAggregatorInflux().

Here is the call graph for this function:

Here is the caller graph for this function:

void perf::TelemetryAggregatorInflux::PushMetrics ( )
privatevirtual

PushMetrics is called after the snapshot of the counters. It should perform all manipulations needed for the counters and the sending/storing of the counters.

Needs to be implemented in the custom telemetry class.

Implements perf::TelemetryAggregator.

Definition at line 256 of file telemetry_aggregator_influx.cc.

Here is the call graph for this function:

TelemetryReturn perf::TelemetryAggregatorInflux::SendToInflux ( const std::string &  payload)
private

Definition at line 227 of file telemetry_aggregator_influx.cc.

Referenced by PushMetrics().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::string perf::TelemetryAggregatorInflux::influx_extra_fields_
private

Definition at line 43 of file telemetry_aggregator_influx.h.

Referenced by MakePayload(), and TelemetryAggregatorInflux().

std::string perf::TelemetryAggregatorInflux::influx_extra_tags_
private
std::string perf::TelemetryAggregatorInflux::influx_host_
private

Definition at line 40 of file telemetry_aggregator_influx.h.

Referenced by OpenSocket(), and TelemetryAggregatorInflux().

std::string perf::TelemetryAggregatorInflux::influx_metric_name_
private
int perf::TelemetryAggregatorInflux::influx_port_
private

Definition at line 41 of file telemetry_aggregator_influx.h.

Referenced by SendToInflux(), and TelemetryAggregatorInflux().

std::map<std::string, int64_t> perf::TelemetryAggregatorInflux::old_counters_
private

Definition at line 39 of file telemetry_aggregator_influx.h.

Referenced by MakeDeltaPayload(), and PushMetrics().

struct addrinfo* perf::TelemetryAggregatorInflux::res_
private
int perf::TelemetryAggregatorInflux::socket_fd_
private

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