BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balm::DefaultMetricsManager Struct Reference

#include <balm_defaultmetricsmanager.h>

Static Public Member Functions

static MetricsManagermanager (MetricsManager *manager=0)
 
static MetricsManagercreate (bslma::Allocator *basicAllocator=0)
 
static MetricsManagercreate (bsl::ostream &stream, bslma::Allocator *basicAllocator=0)
 
static MetricsManagerinstance ()
 
static void destroy ()
 

Detailed Description

This struct provides a namespace for static functions that create, access, and destroy the default instance of the MetricsManager. The expected usage is that the default instance will be created during the initialization of an application (while the task has a single thread) and that it will be destroyed just prior to termination (when there is similarly a single thread).

Member Function Documentation

◆ create() [1/2]

static MetricsManager * balm::DefaultMetricsManager::create ( bsl::ostream &  stream,
bslma::Allocator basicAllocator = 0 
)
static

Create the default MetricsManager instance and configure it with a StreamPublisher that will publish recorded metrics to the specified stream, then return the address of the modifiable created metrics manager instance. Optionally specify basicAllocator to use to obtain memory. If basicAllocator is 0, the currently installed global allocator is used. The behavior is undefined unless 0 == MetricsManager::instance() prior to calling this method, or if this method is called from one thread while another thread is attempting to access the default metrics manager instance (i.e., this method is not thread-safe).

◆ create() [2/2]

static MetricsManager * balm::DefaultMetricsManager::create ( bslma::Allocator basicAllocator = 0)
static

Create the default MetricsManager instance and return the address of the modifiable created instance. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed global allocator is used. The behavior is undefined unless 0 == MetricsManager::instance() prior to calling this method, or if this method is called from one thread while another thread is attempting to access the default metrics manager instance (i.e., this method is not thread-safe). Note that the returned default metrics manager instance is not configured with a publisher; clients must create a Publisher and add it to the default metrics manager in order to publish metrics.

◆ destroy()

static void balm::DefaultMetricsManager::destroy ( )
static

Destroy the default instance of MetricsManager. After this method returns, instance() will return 0. The behavior is undefined if instance() is 0 or if this method is called from one thread while another thread is accessing the default metrics manager instance (i.e., this method is not thread-safe).

◆ instance()

MetricsManager * balm::DefaultMetricsManager::instance ( )
inlinestatic

Return the default instance of the MetricsManager or 0 if the default instance has not yet been created or has already been destroyed.

◆ manager()

MetricsManager * balm::DefaultMetricsManager::manager ( MetricsManager manager = 0)
inlinestatic

If the optionally specified manager is not 0, return manager; otherwise return the address of the default metrics manager instance, or 0 if the default metrics manager instance has not yet been created or has already been destroyed. Note that this operation is logically equivalent to manager ? manager : instance().


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