[#BloombergLP-balm-MetricRegistry-addId]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/MetricRegistry.adoc[MetricRegistry]::addId
:relfileprefix: ../../../
:mrdocs:

Add a metric id for `category` and `name` if not already registered&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balm/MetricId.adoc[MetricId]
addId(
    char const* category,
    char const* name);
----

== Description

Add the specified `category` and `name` to this registry, unless it has already been registered, and return a `balm&colon;&colon;MetricId` object identifying the newly&hyphen;registered metric&period; If the indicated metric has already been registered, the returned `balm&colon;&colon;MetricId` object will _not_ be valid (i&period;e&period;, `isValid` will return `false`)&period; The behavior is undefined unless `category` and `name` are null&hyphen;terminated&period;

== Return Value

newly&hyphen;registered metric id, or an invalid id if already registered

== Parameters

[cols="1,4"]
|===
| Name| Description
| *category*
| null&hyphen;terminated category name
| *name*
| null&hyphen;terminated metric name
|===


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