[#BloombergLP-balm-ConfigurationUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::ConfigurationUtil
:relfileprefix: ../../
:mrdocs:

This `struct` provides utilities for configuring metrics&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct ConfigurationUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/ConfigurationUtil/createUserDataKey.adoc[`createUserDataKey`] 
| Return a new unique key that can be used to associate (via `setUserData`) a value with a metric (or group of metrics)&period; Optionally specify a metrics `manager` to configure&period; If `manager` is 0, configure the default metrics manager&semi; if `manager` is 0 and the default metrics manager has not been initialized, then an unspecified integer value is returned&period; Note that the returned key can be used by clients of `balm` to associate additional information with a metric&period;
| xref:BloombergLP/balm/ConfigurationUtil/setFormat.adoc[`setFormat`] 
| Set the format specification for the metric indicated by the specified `category` and `metricName` to the specified `format`&period; Optionally specify a metrics `manager` to configure&period; If `manager` is 0, configure the default metrics manager&semi; if `manager` is 0 and the default metrics manager has not been initialized, this method has no effect&period; Return 0 on success, or a non&hyphen;zero value if `manager` is 0 and the default metrics manager has not been initialized&period; If a `MetricId` does not exist for `category` and `metricName`, create one and add it to the metric registry of the indicated metrics manager&period;
| xref:BloombergLP/balm/ConfigurationUtil/setFormatSpec.adoc[`setFormatSpec`] 
| Set the format specification for the metric aggregate indicated by the specified `category`, `metricName`, and `publicationType` to the specified `formatSpec`&period; Optionally specify a metrics `manager` to configure&period; If `manager` is 0, configure the default metrics manager&semi; if `manager` is 0 and the default metrics manager has not been initialized, this method has no effect&period; Return 0 on success, or a non&hyphen;zero value if `manager` is 0 and the default metrics manager has not been initialized&period; If a `MetricId` does not exist for `category` and `metricName`, create one and add it to the metric registry of the indicated metrics manager&period; For example a publication type of `e&lowbar;AVG`, and a format spec with a scale of 1000&period;0 and a format of &quot;%&period;2f ms&quot;, 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 &quot; ms&quot;&period;
| xref:BloombergLP/balm/ConfigurationUtil/setPreferredPublicationType.adoc[`setPreferredPublicationType`] 
| Set the preferred publication type of the metric identified by the specified `category` and `metricName` to the specified `publicationType`&period; Optionally specify a metrics `manager` to configure&period; If `manager` is 0, configure the default metrics manager&semi; if `manager` is 0 and the default metrics manager has not been initialized, this method has no effect&period; Return 0 on success, or a non&hyphen;zero value if `manager` is 0 and the default metrics manager has not been initialized&period; The preferred publication type of a metric indicates the preferred aggregate to publish for that metric, or `PublicationType&colon;&colon;e&lowbar;UNSPECIFIED` if there is no preference&period; For example, specifying `e&lowbar;AVG` indicates that the average value of the collected metric should be reported&period; If a `MetricId` does not exist for `category` and `metricName`, create one and add it to the metric registry of the indicated metrics manager&period; Note that there is no uniform definition for how publishers will interpret this value&period;
| xref:BloombergLP/balm/ConfigurationUtil/setUserData-0f.adoc[`setUserData`] 
| `setUserData` overloads
|===



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