[#BloombergLP-balm-CollectorRepository-addCollector-09] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/CollectorRepository.adoc[CollectorRepository]::addCollector :relfileprefix: ../../../ :mrdocs: `addCollector` overloads == Synopses Declared in `<balm_collectorrepository.h>` Return a shared pointer to a newly‐created modifiable collector identified by the specified `metricId` and add that collector to the repository. The behavior is undefined unless `metricId` is a valid id returned by the `MetricRepository` supplied at construction. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<Collector>] xref:BloombergLP/balm/CollectorRepository/addCollector-02.adoc[addCollector](xref:BloombergLP/balm/MetricId.adoc[MetricId] const& metricId); ---- [.small]#xref:BloombergLP/balm/CollectorRepository/addCollector-02.adoc[_» more..._]# Return a shared pointer to a newly‐created modifiable collector identified by the specified null‐terminated strings `category` and `metricName`, and add that collector to the repository. If is not already registered, also add the identified metric to the `metricRegistry` supplied at construction. Note that this operation is logically equivalent to: ` addCollector(registry().getId(category, metricName)) ` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<Collector>] xref:BloombergLP/balm/CollectorRepository/addCollector-0e.adoc[addCollector]( char const* category, char const* metricName); ---- [.small]#xref:BloombergLP/balm/CollectorRepository/addCollector-0e.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#