Quick Links: |
#include <balm_defaultmetricsmanager.h>
Static Public Member Functions | |
static MetricsManager * | manager (MetricsManager *manager=0) |
static MetricsManager * | create (bslma::Allocator *basicAllocator=0) |
static MetricsManager * | create (bsl::ostream &stream, bslma::Allocator *basicAllocator=0) |
static MetricsManager * | instance () |
static void | destroy () |
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).
See Component balm_defaultmetricsmanager
static MetricsManager* balm::DefaultMetricsManager::manager | ( | MetricsManager * | manager = 0 |
) | [static] |
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()
.
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.
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).
static MetricsManager* balm::DefaultMetricsManager::instance | ( | ) | [static] |
Return the default instance of the MetricsManager
or 0 if the default instance has not yet been created or has already been destroyed.
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).