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

#include <statistics.h>

Classes

struct  CounterInfo
 

Public Types

enum  PrintOptions { kPrintSimple = 0, kPrintHeader }
 

Public Member Functions

 Statistics ()
 
 ~Statistics ()
 
StatisticsFork ()
 
CounterRegister (const std::string &name, const std::string &desc)
 
CounterLookup (const std::string &name) const
 
std::string LookupDesc (const std::string &name)
 
std::string PrintList (const PrintOptions print_options)
 
std::string PrintJSON ()
 

Private Member Functions

 Statistics (const Statistics &other)
 
Statisticsoperator= (const Statistics &other)
 

Private Attributes

std::map< std::string,
CounterInfo * > 
counters_
 
pthread_mutex_t * lock_
 

Detailed Description

A collection of Counter objects with a name and a description. Counters in a Statistics class have a name and a description. Thread-safe.

Definition at line 60 of file statistics.h.

Member Enumeration Documentation

Enumerator
kPrintSimple 
kPrintHeader 

Definition at line 62 of file statistics.h.

Constructor & Destructor Documentation

perf::Statistics::Statistics ( )

Definition at line 148 of file statistics.cc.

Here is the call graph for this function:

perf::Statistics::~Statistics ( )

Definition at line 156 of file statistics.cc.

perf::Statistics::Statistics ( const Statistics other)
private

Member Function Documentation

Statistics * perf::Statistics::Fork ( )

Creates a new Statistics binder which maintains the same Counters as the existing one. Changes to those counters are visible in both Statistics objects. The child can then independently add more counters. CounterInfo objects are reference counted and deleted when all the statistics objects dealing with it are destroyed.

Definition at line 47 of file statistics.cc.

Referenced by MountPoint::CreateStatistics().

Here is the caller graph for this function:

string perf::Statistics::LookupDesc ( const std::string &  name)

Definition at line 71 of file statistics.cc.

Statistics& perf::Statistics::operator= ( const Statistics other)
private
string perf::Statistics::PrintJSON ( )

Converts statistics counters into JSON string in following format { "name_major1": { "counter1": val1, "counter2": val2 }, "name_major2": { "counter3": val3 } }

Definition at line 106 of file statistics.cc.

Referenced by receiver::Reactor::HandleSubmitPayload().

Here is the call graph for this function:

Here is the caller graph for this function:

string perf::Statistics::PrintList ( const PrintOptions  print_options)

Definition at line 79 of file statistics.cc.

Referenced by cvmfs_statistics_format(), main(), TalkManager::MainResponder(), RunGarbageCollection(), shrinkwrap::SyncFull(), and shrinkwrap::SyncInit().

Here is the caller graph for this function:

Member Data Documentation

std::map<std::string, CounterInfo *> perf::Statistics::counters_
private

Definition at line 88 of file statistics.h.

Referenced by Fork().

pthread_mutex_t* perf::Statistics::lock_
mutableprivate

Definition at line 89 of file statistics.h.


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