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

Set the preferred publication type of the specified `metric` to the specified `type`&period; The preferred publication type of a metric indicates the preferred aggregate to publish for that metric, or `balm&colon;&colon;PublicationType&colon;&colon;UNSPECIFIED` if there is no preference&period; The behavior is undefined unless `metric` was previously returned by this metric registry&period; Note that there is no uniform definition for how publishers will interpret this value&semi; an `UNSPECIFIED` value generally indicates that the all the collected aggregates (total, count, minimum, and maximum value) should be published&period; Also note that the preferred publication type is accessed through the `balm&colon;&colon;MetricDescription` (i&period;e&period;, `metric&period;description()&hyphen;&gt;preferredPublicationType()`)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setPreferredPublicationType(
    xref:BloombergLP/balm/MetricId.adoc[MetricId] const& metric,
    xref:BloombergLP/balm/PublicationType/Value.adoc[PublicationType::Value] type);
----


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