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

Associate `value` with `key` on `metricId`&apos;s description&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setUserData(
    xref:BloombergLP/balm/MetricId.adoc[MetricId] const& metricId,
    xref:BloombergLP/balm/MetricDescription/UserDataKey.adoc[MetricDescription::UserDataKey] key,
    void const* value);
----

== Description

Associate the specified `value` with the specified `key` in the description of the specified `metricId`&period; The behavior is undefined unless `key` was previously returned from `createUserDataKey`&period; Note that this method allows clients of `balm` to associate (opaque) application&hyphen;specific information with a metric&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *metricId*
| metric whose user data is set
| *key*
| user&hyphen;data key previously obtained from `createUserDataKey`
| *value*
| opaque user&hyphen;data value to associate
|===


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