MetroCollect  2.3.4
MetroCollectFile.cc File Reference
#include <fstream>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <MetroCollect/MetricsController.h>
Include dependency graph for MetroCollectFile.cc:

Go to the source code of this file.

Classes

struct  MetroCollectFile
 Small struct to implement MetricsController delegate. More...
 

Functions

template<typename T , typename S , typename U >
void printMetricsValues (const std::vector< std::pair< std::string, std::string >> &names, const MetroCollect::MetricsArray< T > &m1, const MetroCollect::MetricsArray< S > &m2, const MetroCollect::MetricsArray< U > &d)
 Print metrics on screen. More...
 
void printMetricsStats (const std::vector< std::pair< std::string, std::string >> &names, const MetroCollect::MetricsController::MetricsStats &s)
 Print metric stats on screen. More...
 
auto generateMetrics ()
 Generate metric request to give to the MetricsController. More...
 
template<typename T >
auto getAllFieldNames (const MetroCollect::MetricsArray< T > &metricsArray)
 Get fields name of all metrics. More...
 
int main (int argc, char *argv[])
 MetroCollectFile main function. More...
 

Function Documentation

◆ generateMetrics()

auto generateMetrics ( )

Generate metric request to give to the MetricsController.

Returns
auto requested metrics list

Definition at line 76 of file MetroCollectFile.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllFieldNames()

template<typename T >
auto getAllFieldNames ( const MetroCollect::MetricsArray< T > &  metricsArray)

Get fields name of all metrics.

Template Parameters
TType of MetricsArray
Parameters
metricsArrayMetricArray to get metric names from
Returns
Array of metric names

Definition at line 96 of file MetroCollectFile.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

MetroCollectFile main function.

MetroCollect's main function.

Parameters
argcArgument count (expected: 3)
argvArguments values (sampling interval; iteration count; file path to write to)
Returns
int Return code

Definition at line 162 of file MetroCollectFile.cc.

◆ printMetricsStats()

void printMetricsStats ( const std::vector< std::pair< std::string, std::string >> &  names,
const MetroCollect::MetricsController::MetricsStats s 
)

Print metric stats on screen.

Parameters
namesarray of names of the metrics
sMetrics Stats Arrays to print

Definition at line 55 of file MetroCollectFile.cc.

Here is the call graph for this function:

◆ printMetricsValues()

template<typename T , typename S , typename U >
void printMetricsValues ( const std::vector< std::pair< std::string, std::string >> &  names,
const MetroCollect::MetricsArray< T > &  m1,
const MetroCollect::MetricsArray< S > &  m2,
const MetroCollect::MetricsArray< U > &  d 
)

Print metrics on screen.

Template Parameters
TType of first MetricsArray
SType of second MetricsArray
UType of third MetricsArray
Parameters
namesarray of names of the metrics
m1First MetricsDataArray: earlier values
m2Second MetricsDataArray: latest values
dThird MetricsDiffArray: differences

Definition at line 41 of file MetroCollectFile.cc.

Here is the call graph for this function: