[#BloombergLP-balm-MetricsManager-publish-028]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]::publish
:relfileprefix: ../../../
:mrdocs:

`publish` overloads

== Synopses

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

Publish metrics belonging to the specified `categories`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/balm/MetricsManager/publish-02e.adoc[publish](
    xref:bsl/set-0d.adoc[bsl::set&lt;Category const*&gt;] const& categories,
    bool resetFlag = true);
----

[.small]#xref:BloombergLP/balm/MetricsManager/publish-02e.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using a `std&colon;&colon;pmr&colon;&colon;set` of categories&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/balm/MetricsManager/publish-08.adoc[publish](
    std::pmr::set&lt;Category const*&gt; const& categories,
    bool resetFlag = true);
----

[.small]#xref:BloombergLP/balm/MetricsManager/publish-08.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using a `std&colon;&colon;set` of categories&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/balm/MetricsManager/publish-020.adoc[publish](
    std::set&lt;Category const*&gt; const& categories,
    bool resetFlag = true);
----

[.small]#xref:BloombergLP/balm/MetricsManager/publish-020.adoc[_» more&period;&period;&period;_]#

Publish metrics associated with the specified `category` if `category` is enabled&semi; otherwise (if `category` is not enabled) this method has no effect&period; Optionally specify a `resetFlag` that determines if the collected metrics are reset as part of this operation&period; If `category` is enabled (i&period;e&period;, `category&hyphen;&gt;isEnabled()` is `true`), this operation will collect aggregated metric values for `category` from any registered callbacks as well as from its own `CollectorRepository`, and then publish those records using any publishers associated with `category`&period; If `resetFlag` is `true`, the metrics being collected are reset to their default state&period; The metrics manager provides publishers the time interval over which the published metrics were collected&period; This interval is computed as the elapsed time since the last time the `category` was reset (either through a call to the `publish` or `collectSample` methods)&period; If `category` has not previously been reset then this interval is taken to be the elapsed time since the creation of this metrics manager&period; Note that the alternative `publish` methods that publish multiple categories in a single invocation are more efficient than publishing a sequence of categories individually&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/balm/MetricsManager/publish-03a.adoc[publish](
    xref:BloombergLP/balm/Category.adoc[Category] const* category,
    bool resetFlag = true);
----

[.small]#xref:BloombergLP/balm/MetricsManager/publish-03a.adoc[_» more&period;&period;&period;_]#

Publish metrics belonging to the specified sequence of (unique) `categories`, of specified length `numCategories`&period; Optionally specify a `resetFlag` that determines if the collected metrics are reset as part of this operation&period; This operation will collect aggregated metric values for each _enabled_ category in `categories` from registered callbacks as well as from its own `CollectorRepository`, and then publish those records using any publishers associated with the category&period; Any individual category in `categories` that is not enabled is ignored&period; If `resetFlag` is `true`, the metrics being collected are reset to their default state&period; The metrics manager provides publishers the time interval over which the published metrics were collected&period; This interval is computed as the elapsed time since the last time the `category` was reset (either through a call to the `publish` or `collectSample` methods)&period; If a category has not previously been reset then this interval is taken to be the elapsed time since the creation of this metrics manager&period; The behavior is undefined unless `0 &lt;&equals; numCategories`, `categories` refers to a contiguous sequence of (at least) `numCategories`, and each category in `categories` appears only once&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/balm/MetricsManager/publish-03e.adoc[publish](
    xref:BloombergLP/balm/Category.adoc[Category] const const* categories[],
    int numCategories,
    bool resetFlag = true);
----

[.small]#xref:BloombergLP/balm/MetricsManager/publish-03e.adoc[_» more&period;&period;&period;_]#


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