[#BloombergLP-balm-CollectorRepository-addCollector-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/CollectorRepository.adoc[CollectorRepository]::addCollector :relfileprefix: ../../../ :mrdocs: Return a shared pointer to a new collector for the specified `metricId` and add it to the repository. == Synopsis Declared in `<balm_collectorrepository.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<Collector>] addCollector(xref:BloombergLP/balm/MetricId.adoc[MetricId] const& metricId); ---- == Description The behavior is undefined unless `metricId` is a valid id returned by the `MetricRepository` supplied at construction. == Return Value shared pointer to the newly created collector == Parameters [cols="1,4"] |=== | Name| Description | *metricId* | identity of the metric for the new collector |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#