BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balm::CollectorRepository Class Reference

#include <balm_collectorrepository.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (CollectorRepository, bslma::UsesBslmaAllocator)
 
 CollectorRepository (MetricRegistry *registry, bslma::Allocator *basicAllocator=0)
 
 ~CollectorRepository ()
 Free all the collectors in this repository and destroy this object.
 
void collectAndReset (bsl::vector< MetricRecord > *records, const Category *category)
 
void collectAndReset (std::vector< MetricRecord > *records, const Category *category)
 
void collect (bsl::vector< MetricRecord > *records, const Category *category)
 
void collect (std::vector< MetricRecord > *records, const Category *category)
 
CollectorgetDefaultCollector (const char *category, const char *metricName)
 
CollectorgetDefaultCollector (const MetricId &metricId)
 
IntegerCollectorgetDefaultIntegerCollector (const char *category, const char *metricName)
 
IntegerCollectorgetDefaultIntegerCollector (const MetricId &metricId)
 
bsl::shared_ptr< CollectoraddCollector (const char *category, const char *metricName)
 
bsl::shared_ptr< CollectoraddCollector (const MetricId &metricId)
 
bsl::shared_ptr< IntegerCollectoraddIntegerCollector (const char *category, const char *metricName)
 
bsl::shared_ptr< IntegerCollectoraddIntegerCollector (const MetricId &metricId)
 
int getAddedCollectors (bsl::vector< bsl::shared_ptr< Collector > > *collectors, bsl::vector< bsl::shared_ptr< IntegerCollector > > *intCollectors, const MetricId &metricId)
 
int getAddedCollectors (std::vector< bsl::shared_ptr< Collector > > *collectors, std::vector< bsl::shared_ptr< IntegerCollector > > *intCollectors, const MetricId &metricId)
 
MetricRegistryregistry ()
 
const MetricRegistryregistry () const
 

Detailed Description

This class defines a fully thread-safe repository mechanism for Collector and IntegerCollector objects. Collectors are identified in the repository by a MetricId object and also grouped together according to the category of the metric. This repository supports operations to create, find, and collect metric records from the collectors in the repository.

See balm_collectorrepository

Constructor & Destructor Documentation

◆ CollectorRepository()

balm::CollectorRepository::CollectorRepository ( MetricRegistry registry,
bslma::Allocator basicAllocator = 0 
)
inline

Create an empty collector repository that will use the specified registry to identify the metrics for which it manages collectors. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined if registry is 0.

◆ ~CollectorRepository()

balm::CollectorRepository::~CollectorRepository ( )
inline

Member Function Documentation

◆ addCollector() [1/2]

bsl::shared_ptr< Collector > balm::CollectorRepository::addCollector ( const char *  category,
const char *  metricName 
)
inline

Return a shared pointer to a newly-created modifiable collector identified by the specified null-terminated strings category and metricName, and add that collector to the repository. If is not already registered, also add the identified metric to the metricRegistry supplied at construction. Note that this operation is logically equivalent to:

addCollector(registry().getId(category, metricName))
MetricRegistry & registry()
Definition balm_collectorrepository.h:469
bsl::shared_ptr< Collector > addCollector(const char *category, const char *metricName)
Definition balm_collectorrepository.h:453

◆ addCollector() [2/2]

bsl::shared_ptr< Collector > balm::CollectorRepository::addCollector ( const MetricId metricId)

Return a shared pointer to a newly-created modifiable collector identified by the specified metricId and add that collector to the repository. The behavior is undefined unless metricId is a valid id returned by the MetricRepository supplied at construction.

◆ addIntegerCollector() [1/2]

bsl::shared_ptr< IntegerCollector > balm::CollectorRepository::addIntegerCollector ( const char *  category,
const char *  metricName 
)
inline

Return a shared pointer to a newly created modifiable integer collector identified by the specified category and metricName and add that collector to the repository. If is not already registered, also add the identified metric to the metricRegistry supplied at construction. The behavior is undefined unless category and metricName are null-terminated. Note that this operation is logically equivalent to:

addIntegerCollector(registry().getId(category, metricName))
bsl::shared_ptr< IntegerCollector > addIntegerCollector(const char *category, const char *metricName)
Definition balm_collectorrepository.h:462

◆ addIntegerCollector() [2/2]

bsl::shared_ptr< IntegerCollector > balm::CollectorRepository::addIntegerCollector ( const MetricId metricId)

Return a shared pointer to a newly-created modifiable collector identified by the specified metricId and add that collector to the repository. The behavior is undefined unless metricId is a valid id returned by the MetricRepository supplied at construction.

◆ BSLMF_NESTED_TRAIT_DECLARATION()

balm::CollectorRepository::BSLMF_NESTED_TRAIT_DECLARATION ( CollectorRepository  ,
bslma::UsesBslmaAllocator   
)

◆ collect() [1/2]

void balm::CollectorRepository::collect ( bsl::vector< MetricRecord > *  records,
const Category category 
)

◆ collect() [2/2]

void balm::CollectorRepository::collect ( std::vector< MetricRecord > *  records,
const Category category 
)

◆ collectAndReset() [1/2]

void balm::CollectorRepository::collectAndReset ( bsl::vector< MetricRecord > *  records,
const Category category 
)

◆ collectAndReset() [2/2]

void balm::CollectorRepository::collectAndReset ( std::vector< MetricRecord > *  records,
const Category category 
)

◆ getAddedCollectors() [1/2]

int balm::CollectorRepository::getAddedCollectors ( bsl::vector< bsl::shared_ptr< Collector > > *  collectors,
bsl::vector< bsl::shared_ptr< IntegerCollector > > *  intCollectors,
const MetricId metricId 
)

◆ getAddedCollectors() [2/2]

int balm::CollectorRepository::getAddedCollectors ( std::vector< bsl::shared_ptr< Collector > > *  collectors,
std::vector< bsl::shared_ptr< IntegerCollector > > *  intCollectors,
const MetricId metricId 
)

◆ getDefaultCollector() [1/2]

Collector * balm::CollectorRepository::getDefaultCollector ( const char *  category,
const char *  metricName 
)
inline

Return the address of the modifiable default collector identified by the specified null-terminated strings category and metricName. If a collector for the identified metric does not already exist in the repository, create one, add it to the repository, and return its address. In addition, if the identified metric has not already been registered, add the identified metric to the metricRegistry supplied at construction. Note that this operation is logically equivalent to:

getDefaultCollector(registry().getId(category, metricName))
Collector * getDefaultCollector(const char *category, const char *metricName)
Definition balm_collectorrepository.h:437

◆ getDefaultCollector() [2/2]

Collector * balm::CollectorRepository::getDefaultCollector ( const MetricId metricId)

Return the address of the modifiable default collector identified by the specified metricId. If a default collector for the identified metric does not already exist in the repository, create one, add it to the repository, and return its address.

◆ getDefaultIntegerCollector() [1/2]

IntegerCollector * balm::CollectorRepository::getDefaultIntegerCollector ( const char *  category,
const char *  metricName 
)
inline

Return the address of the modifiable default integer collector identified by the specified category and metricName. If a default integer collector for the identified metric does not already exist in the repository, create one, add it to the repository, and return its address. In addition, if the identified metric has not already been registered, add the identified metric to the metricRegistry supplied at construction. The behavior is undefined unless category and metricName are null-terminated. Note that this operation is logically equivalent to:

getDefaultIntegerCollector(registry().getId(category, metricName))
IntegerCollector * getDefaultIntegerCollector(const char *category, const char *metricName)
Definition balm_collectorrepository.h:444

◆ getDefaultIntegerCollector() [2/2]

IntegerCollector * balm::CollectorRepository::getDefaultIntegerCollector ( const MetricId metricId)

Return the address of the modifiable default integer collector identified by the specified metricId. If a default integer collector for the identified metric does not already exist in the repository, create one, add it to the repository, and return its address.

◆ registry() [1/2]

MetricRegistry & balm::CollectorRepository::registry ( )
inline

Return a reference to the modifiable registry of metrics used by this collector repository.

◆ registry() [2/2]

const MetricRegistry & balm::CollectorRepository::registry ( ) const
inline

Return a reference to the non-modifiable registry of metrics used by this collector repository.


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