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

#include <balm_bdlmmetricsadapter.h>

Inheritance diagram for balm::BdlmMetricsAdapter:
bdlm::MetricsAdapter

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (BdlmMetricsAdapter, bslma::UsesBslmaAllocator)
 
 BdlmMetricsAdapter (MetricsManager *metricsManager, const bsl::string_view &metricNamespace, const bsl::string_view &objectIdentifierPrefix, bslma::Allocator *basicAllocator=0)
 
 ~BdlmMetricsAdapter () BSLS_KEYWORD_OVERRIDE
 Destroy this BdlmMetricsAdapter object.
 
CallbackHandle registerCollectionCallback (const bdlm::MetricDescriptor &metricDescriptor, const Callback &callback) BSLS_KEYWORD_OVERRIDE
 
int removeCollectionCallback (const CallbackHandle &handle) BSLS_KEYWORD_OVERRIDE
 
const bsl::stringdefaultMetricNamespace () const
 
const bsl::stringdefaultObjectIdentifierPrefix () const
 
bslma::Allocatorallocator () const
 Return the allocator used by this object to supply memory.
 
- Public Member Functions inherited from bdlm::MetricsAdapter
virtual ~MetricsAdapter ()=0
 Destroy this MetricsAdapter.
 

Additional Inherited Members

- Public Types inherited from bdlm::MetricsAdapter
typedef int CallbackHandle
 
typedef bsl::function< void(Metric *)> Callback
 

Detailed Description

This class implements a pure abstract interface for clients and suppliers of metrics adapters. The implementation registers callbacks with a provided balm::MetricsManager to enable monitoring of statistics collection objects.

See balm_bdlmmetricsadapter

Constructor & Destructor Documentation

◆ BdlmMetricsAdapter()

balm::BdlmMetricsAdapter::BdlmMetricsAdapter ( balm::MetricsManager metricsManager,
const bsl::string_view metricNamespace,
const bsl::string_view objectIdentifierPrefix,
bslma::Allocator basicAllocator = 0 
)
inline

Create a BdlmMetricsAdapter object that uses the specified metricsManager to register and unregister collection callback functors, the specified metricNamespace as the value returned by defaultNamespace(), and the specified objectIdentifierPrefix as the value returned by defaultObjectIdentifierPrefix. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~BdlmMetricsAdapter()

balm::BdlmMetricsAdapter::~BdlmMetricsAdapter ( )

Member Function Documentation

◆ allocator()

bslma::Allocator * balm::BdlmMetricsAdapter::allocator ( ) const
inline

◆ BSLMF_NESTED_TRAIT_DECLARATION()

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

◆ defaultMetricNamespace()

const bsl::string & balm::BdlmMetricsAdapter::defaultMetricNamespace ( ) const
inline

Return the namespace attribute value to be used as the default value for MetricDescriptor instances.

◆ defaultObjectIdentifierPrefix()

const bsl::string & balm::BdlmMetricsAdapter::defaultObjectIdentifierPrefix ( ) const
inline

Return a string to be used as the default prefix for a MetricDescriptor object identifier attribute value.

◆ registerCollectionCallback()

CallbackHandle balm::BdlmMetricsAdapter::registerCollectionCallback ( const bdlm::MetricDescriptor metricDescriptor,
const Callback callback 
)
virtual

Register the specified callback with the metrics manager specified at construction, using the specified metricDescriptor. If metricDescriptor.metricsNamspace() equals bdlm::MetricDescriptor::k_USE_METRICS_ADAPTER_NAMESPACE_SELECTION, use defaultMetricNamespace() for the namespace attribute during registration. If metricDescriptor.objectIdentifier() equals bdlm::MetricDescriptor::k_USE_METRICS_ADAPTER_OBJECT_ID_SELECTION, use the concatination of defaultObjectIdentifierPrefix(), a period, metricDescriptor.objectTypeAbbreviation(), a period, and metricDescriptor.instanceNumber() for the object identifier attribute during registration. The category name supplied to the MetricsManager provided at construction is the concatenation of the object type name attribute, a period, the metric name attribute, a period, and the object identifier attribute. Return the callback handle to be used with removeCollectionCallback.

Implements bdlm::MetricsAdapter.

◆ removeCollectionCallback()

int balm::BdlmMetricsAdapter::removeCollectionCallback ( const CallbackHandle handle)
inlinevirtual

Remove the callback associated with the specified handle. Return 0 on success, or a non-zero value if handle cannot be found.

Implements bdlm::MetricsAdapter.


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