[#BloombergLP-balm-IntegerMetric_MacroImp-getCollector-03]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/IntegerMetric_MacroImp.adoc[IntegerMetric&lowbar;MacroImp]::getCollector
:relfileprefix: ../../../
:mrdocs:

Load a default integer collector and register the category holder for a metric&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
getCollector(
    xref:BloombergLP/balm/IntegerCollector.adoc[IntegerCollector]** collector,
    xref:BloombergLP/balm/CategoryHolder.adoc[CategoryHolder]* holder,
    char const* category,
    char const* metric);
----

== Description

Load the specified `collector` with the address of the default integer collector (from the default metrics manager) for the specified `metric` identified by the specified `category` and `name`, and register the specified `holder` for `category`&period; Note that `&ast;collector` must be assigned *before* registering `holder` to ensure that the macros always have a valid `collector` when `holder&hyphen;&gt;enabled()` is `true`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *collector*
| receives the address of the default integer collector
| *holder*
| category holder to register for `category`
| *category*
| null&hyphen;terminated metric category name
| *metric*
| null&hyphen;terminated metric name
|===


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