[#BloombergLP-balm-MetricsManager-setCategoryEnabled-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]::setCategoryEnabled
:relfileprefix: ../../../
:mrdocs:

Set whether the named `category` is enabled&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setCategoryEnabled(
    char const* category,
    bool isEnabled = true);
----

== Description

Set whether the specified `category` is enabled to the optionally specified `isEnabled` value&period; If `category` has not been registered, register it with the `metricRegistry()`&period; If a category is disabled it will not be published (see the `publish` methods), and higher level components may not record values for metrics belonging to the category (for an example, see the `balm&lowbar;metric` documentation)&period; Note that this operation is _not_ atomic, and other threads may simultaneously access the current enabled value for `category` while this operation is performed&period; Also note that this operation has _linear_ performance with respect to the number of registered category holders for `category` (see `balm&lowbar;metricregistry` and `balm&lowbar;category` for information on category holders)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *category*
| null&hyphen;terminated category name
| *isEnabled*
| `true` to enable the category, `false` to disable it
|===


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