BloombergLP::balm::MetricsManager::addSpecificPublisher

Add a publisher used only for the specified category.

Synopsis

Declared in <balm_metricsmanager.h>

int
addSpecificPublisher(
    Category const* category,
    bsl::shared_ptr<Publisher> const& publisher);

Description

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).

Return Value

0 on success, and a non-zero value with no effect if publisher has already been registered for category

Parameters

NameDescription
categorycategory for which to register the publisher
publisherpublisher to register for category