BloombergLP::balm::ConfigurationUtil::setUserData

Associate value with key on one metric's description.

Synopsis

Declared in <balm_configurationutil.h>

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

Description

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.

Parameters

NameDescription
categorycategory of the metric to update
metricNamename of the metric to update
keyuser-data key previously obtained from createUserDataKey
valueopaque user-data value to associate
managermetrics manager to configure; 0 uses the default