[#BloombergLP-balm-ConfigurationUtil-setUserData-0f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/ConfigurationUtil.adoc[ConfigurationUtil]::setUserData :relfileprefix: ../../../ :mrdocs: `setUserData` overloads == Synopses Declared in `<balm_configurationutil.h>` 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`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/balm/ConfigurationUtil/setUserData-04.adoc[setUserData]( char const* categoryName, xref:BloombergLP/balm/MetricDescription/UserDataKey.adoc[MetricDescription::UserDataKey] key, void const* value, xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0); ---- [.small]#xref:BloombergLP/balm/ConfigurationUtil/setUserData-04.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/balm/ConfigurationUtil/setUserData-09.adoc[setUserData]( char const* category, char const* metricName, xref:BloombergLP/balm/MetricDescription/UserDataKey.adoc[MetricDescription::UserDataKey] key, void const* value, xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0); ---- [.small]#xref:BloombergLP/balm/ConfigurationUtil/setUserData-09.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#