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

#include <balm_configurationutil.h>

Static Public Member Functions

static int setFormat (const char *category, const char *metricName, const MetricFormat &format, MetricsManager *manager=0)
 
static int setFormatSpec (const char *category, const char *metricName, PublicationType::Value publicationType, const MetricFormatSpec &formatSpec, MetricsManager *manager=0)
 
static int setPreferredPublicationType (const char *category, const char *metricName, PublicationType::Value publicationType, MetricsManager *manager=0)
 
static MetricDescription::UserDataKey createUserDataKey (MetricsManager *manager=0)
 
static void setUserData (const char *category, const char *metricName, MetricDescription::UserDataKey key, const void *value, MetricsManager *manager=0)
 
static void setUserData (const char *categoryName, MetricDescription::UserDataKey key, const void *value, MetricsManager *manager=0)
 

Member Function Documentation

◆ createUserDataKey()

static MetricDescription::UserDataKey balm::ConfigurationUtil::createUserDataKey ( MetricsManager manager = 0)
static

Return a new unique key that can be used to associate (via setUserData) a value with a metric (or group of metrics). Optionally specify a metrics manager to configure. If manager is 0, configure the default metrics manager; if manager is 0 and the default metrics manager has not been initialized, then an unspecified integer value is returned. Note that the returned key can be used by clients of balm to associate additional information with a metric.

◆ setFormat()

static int balm::ConfigurationUtil::setFormat ( const char *  category,
const char *  metricName,
const MetricFormat format,
MetricsManager manager = 0 
)
static

Set the format specification for the metric indicated by the specified category and metricName to the specified format. Optionally specify a metrics manager to configure. If manager is 0, configure the default metrics manager; if manager is 0 and the default metrics manager has not been initialized, this method has no effect. Return 0 on success, or a non-zero value if manager is 0 and the default metrics manager has not been initialized. If a MetricId does not exist for category and metricName, create one and add it to the metric registry of the indicated metrics manager.

◆ setFormatSpec()

static int balm::ConfigurationUtil::setFormatSpec ( const char *  category,
const char *  metricName,
PublicationType::Value  publicationType,
const MetricFormatSpec formatSpec,
MetricsManager manager = 0 
)
static

Set the format specification for the metric aggregate indicated by the specified category, metricName, and publicationType to the specified formatSpec. Optionally specify a metrics manager to configure. If manager is 0, configure the default metrics manager; if manager is 0 and the default metrics manager has not been initialized, this method has no effect. Return 0 on success, or a non-zero value if manager is 0 and the default metrics manager has not been initialized. If a MetricId does not exist for category and metricName, create one and add it to the metric registry of the indicated metrics manager. For example a publication type of e_AVG, and a format spec with a scale of 1000.0 and a format of "%.2f ms", indicates that the average value of the indicated metric should be formatted by scaling the value by 1000 and then rounding the value to the second decimal place and appending " ms".

◆ setPreferredPublicationType()

static int balm::ConfigurationUtil::setPreferredPublicationType ( const char *  category,
const char *  metricName,
PublicationType::Value  publicationType,
MetricsManager manager = 0 
)
static

Set the preferred publication type of the metric identified by the specified category and metricName to the specified publicationType. Optionally specify a metrics manager to configure. If manager is 0, configure the default metrics manager; if manager is 0 and the default metrics manager has not been initialized, this method has no effect. Return 0 on success, or a non-zero value if manager is 0 and the default metrics manager has not been initialized. The preferred publication type of a metric indicates the preferred aggregate to publish for that metric, or PublicationType::e_UNSPECIFIED if there is no preference. For example, specifying e_AVG indicates that the average value of the collected metric should be reported. If a MetricId does not exist for category and metricName, create one and add it to the metric registry of the indicated metrics manager. Note that there is no uniform definition for how publishers will interpret this value.

◆ setUserData() [1/2]

static void balm::ConfigurationUtil::setUserData ( const char *  category,
const char *  metricName,
MetricDescription::UserDataKey  key,
const void *  value,
MetricsManager manager = 0 
)
static

Associate the specified value with the specified data key in the description of the metric having the specified category and metricName. Optionally specify a metrics manager to configure. If manager is 0, configure the default metrics manager; if manager is 0 and the default metrics manager has not been initialized, this method has no effect. If a MetricId does not exist for the category and metricName, create one and add it to the metric registry of the indicated metrics manager. The behavior is undefined unless key was previously created for the indicated metrics manager's metrics registry (e.g., by calling createUserDataKey). Note that this method allows clients of balm to associate (opaque) application-specific information with a metric.

◆ setUserData() [2/2]

static void balm::ConfigurationUtil::setUserData ( const char *  categoryName,
MetricDescription::UserDataKey  key,
const void *  value,
MetricsManager manager = 0 
)
static

Associate the specified value with the specified data key in any metric belonging to a category having the specified categoryName, or, if categoryName ends with an asterisk (*), any metric belonging to a category whose name begins with categoryName (without the asterisk). Optionally specify a metrics manager to configure. If manager is 0, configure the default metrics manager; if manager is 0 and the default metrics manager has not been initialized, this method has no effect. This association applies to existing metrics as well as any subsequently created ones. When a metric is created that matches more than one registered category prefix, it is not specified which supplied value will be associated with key, unless only one of those values is non-null, in which case the unique non-null value is used. The behavior is undefined unless key was previously created for the indicated metrics manager's metrics registry (e.g., by calling createUserDataKey).


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