[#BloombergLP-balm-CollectorRepository-addIntegerCollector-06a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/CollectorRepository.adoc[CollectorRepository]::addIntegerCollector
:relfileprefix: ../../../
:mrdocs:

Return a shared pointer to a new integer collector for the specified `category` and `metricName`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/shared_ptr-0a.adoc[bsl::shared&lowbar;ptr&lt;IntegerCollector&gt;]
addIntegerCollector(
    char const* category,
    char const* metricName);
----

== Description

Return a shared pointer to a newly created modifiable integer collector identified by the specified `category` and `metricName` and add that collector to the repository&period; If is not already registered, also add the identified metric to the `metricRegistry` supplied at construction&period; The behavior is undefined unless `category` and `metricName` are null&hyphen;terminated&period; Note that this operation is logically equivalent to&colon; &grave; addIntegerCollector(registry()&period;getId(category, metricName)) &grave;

== Return Value

shared pointer to the newly created integer collector

== Parameters

[cols="1,4"]
|===
| Name| Description
| *category*
| null&hyphen;terminated category name
| *metricName*
| null&hyphen;terminated metric name
|===


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