[#BloombergLP-balm-MetricRegistry-setUserData-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/MetricRegistry.adoc[MetricRegistry]::setUserData
:relfileprefix: ../../../
:mrdocs:

Associate the specified `value` with the specified `key` in any metric belonging to a category having the specified `categoryName`, or a category whose name begins with `categoryName`, as determined by the optionally specified `prefixFlag`&period; If `prefixFlag` is `false` or is not specified, only those metrics belonging to a category having `categoryName` will be mapped&semi; otherwise, `value` will be associated with `key` for all metrics belonging to any category whose name begins with `categoryName`&period; This association applies to existing metrics as well as any subsequently created ones&period; 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&hyphen;null, in which case the unique non&hyphen;null value is used&period; The behavior is undefined unless `key` was previously returned from `createUserDataKey`&period;

== Synopsis

Declared in `&lt;balm&lowbar;metricregistry&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setUserData(
    char const* categoryName,
    xref:BloombergLP/balm/MetricDescription/UserDataKey.adoc[MetricDescription::UserDataKey] key,
    void const* value,
    bool prefixFlag = false);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
