[#BloombergLP-balm-MetricsManager-addSpecificPublisher-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]::addSpecificPublisher :relfileprefix: ../../../ :mrdocs: `addSpecificPublisher` overloads == Synopses Declared in `<balm_metricsmanager.h>` Add the specified `publisher` to the set of publishers that will be used to publish metrics for the specified `category`. Return 0 on success, and a non‐zero value with no effect if `publisher` has already been registered to publish `category`. The behavior is undefined unless `category` is a valid address returned by the `metricRegistry` method. Note that this method will fail and return a non‐zero value if `publisher` has previously been registered to publish _every_ category (using the alternative `addGeneralPublisher` method). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/balm/MetricsManager/addSpecificPublisher-0f.adoc[addSpecificPublisher]( xref:BloombergLP/balm/Category.adoc[Category] const* category, xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<Publisher>] const& publisher); ---- [.small]#xref:BloombergLP/balm/MetricsManager/addSpecificPublisher-0f.adoc[_» more..._]# Add the specified `publisher` to the set of publishers that will be used to publish metrics for the category identified by the specified `categoryName`. Return 0 on success, and a non‐zero value with no effect if `publisher` has already been registered to publish the identified category. The behavior is undefined unless `categoryName` is null‐terminated. Note that this method will fail and return a non‐zero value if `publisher` has previously been registered to publish _every_ category (using the alternative `addGeneralPublisher` method). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/balm/MetricsManager/addSpecificPublisher-0e.adoc[addSpecificPublisher]( char const* categoryName, xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<Publisher>] const& publisher); ---- [.small]#xref:BloombergLP/balm/MetricsManager/addSpecificPublisher-0e.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#