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

#include <telemetry_aggregator.h>

Inheritance diagram for perf::TelemetryAggregator:
Collaboration diagram for perf::TelemetryAggregator:

Public Member Functions

virtual ~TelemetryAggregator ()
 
void Spawn ()
 

Static Public Member Functions

static TelemetryAggregatorCreate (Statistics *statistics, int send_rate, OptionsManager *options_mgr, MountPoint *mount_point, const std::string &fqrn, const TelemetrySelector type)
 

Protected Member Functions

 TelemetryAggregator (Statistics *statistics, int send_rate_sec, MountPoint *mount_point, const std::string &fqrn)
 
virtual void PushMetrics ()=0
 

Static Protected Member Functions

static void * MainTelemetry (void *data)
 

Protected Attributes

Statisticsstatistics_
 
const int send_rate_sec_
 
MountPointmount_point_
 
int pipe_terminate_ [2]
 
pthread_t thread_telemetry_
 
std::string fqrn_
 
bool is_zombie_
 
uint64_t timestamp_
 
std::map< std::string, int64_t > counters_
 

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)
 
void ManuallyUpdateSelectedCounters ()
 
- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Detailed Description

Definition at line 44 of file telemetry_aggregator.h.

Constructor & Destructor Documentation

perf::TelemetryAggregator::~TelemetryAggregator ( )
virtual

Definition at line 56 of file telemetry_aggregator.cc.

Here is the call graph for this function:

perf::TelemetryAggregator::TelemetryAggregator ( Statistics statistics,
int  send_rate_sec,
MountPoint mount_point,
const std::string &  fqrn 
)
inlineprotected

Base constructor taking care of threading infrastructure. Must always be called in the constructor of the custom telemetry classes.

Definition at line 101 of file telemetry_aggregator.h.

Member Function Documentation

TelemetryAggregator * perf::TelemetryAggregator::Create ( Statistics statistics,
int  send_rate,
OptionsManager options_mgr,
MountPoint mount_point,
const std::string &  fqrn,
const TelemetrySelector  type 
)
static

Creates the requested telemetry aggregator. This function is also used to register new classes to aggregate telemetry.

Returns the newly created TelemetryAggregator or NULL if the creation was not successful.

Definition at line 22 of file telemetry_aggregator.cc.

Referenced by MountPoint::SetupBehavior().

Here is the call graph for this function:

Here is the caller graph for this function:

perf::TelemetryAggregator::FRIEND_TEST ( T_TelemetryAggregator  ,
EmptyCounters   
)
private
perf::TelemetryAggregator::FRIEND_TEST ( T_TelemetryAggregator  ,
FailCreate   
)
private
perf::TelemetryAggregator::FRIEND_TEST ( T_TelemetryAggregator  ,
ExtraFields_Tags   
)
private
perf::TelemetryAggregator::FRIEND_TEST ( T_TelemetryAggregator  ,
UpdateCounters_WithExtraFields_Tags   
)
private
void * perf::TelemetryAggregator::MainTelemetry ( void *  data)
staticprotected

Main loop executed by the telemetry thread. Checks every x seconds if the telemetry thread should continue running. If yes, takes a snapshot of all statistic counters that are not 0 and calls PushMetrics()

PushMetrics() is defined by the custom telemetry classes and performs all operation on the statistic counters to send/store them.

Definition at line 116 of file telemetry_aggregator.cc.

Referenced by Spawn().

Here is the call graph for this function:

Here is the caller graph for this function:

void perf::TelemetryAggregator::ManuallyUpdateSelectedCounters ( )
private

Some counters must be manually set to get the current value. Copied from talk.cc:MainResponder()

Definition at line 74 of file telemetry_aggregator.cc.

Referenced by MainTelemetry().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void perf::TelemetryAggregator::PushMetrics ( )
protectedpure virtual

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.

Implemented in perf::TelemetryAggregatorInflux.

Referenced by MainTelemetry().

Here is the caller graph for this function:

void perf::TelemetryAggregator::Spawn ( )

Spawns the telemetry thread.

Definition at line 65 of file telemetry_aggregator.cc.

Referenced by Spawn().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::map<std::string, int64_t> perf::TelemetryAggregator::counters_
protected
std::string perf::TelemetryAggregator::fqrn_
protected
bool perf::TelemetryAggregator::is_zombie_
protected
MountPoint* perf::TelemetryAggregator::mount_point_
protected

Definition at line 74 of file telemetry_aggregator.h.

Referenced by ManuallyUpdateSelectedCounters().

int perf::TelemetryAggregator::pipe_terminate_[2]
protected
const int perf::TelemetryAggregator::send_rate_sec_
protected

Definition at line 73 of file telemetry_aggregator.h.

Referenced by MainTelemetry(), and Spawn().

Statistics* perf::TelemetryAggregator::statistics_
protected

Definition at line 72 of file telemetry_aggregator.h.

Referenced by MainTelemetry().

pthread_t perf::TelemetryAggregator::thread_telemetry_
protected

Definition at line 76 of file telemetry_aggregator.h.

Referenced by Spawn(), TelemetryAggregator(), and ~TelemetryAggregator().

uint64_t perf::TelemetryAggregator::timestamp_
protected

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