Associate value with key on metrics matching categoryName.
Declared in <balm_metricregistry.h>
void
setUserData(
char const* categoryName,
MetricDescription::UserDataKey key,
void const* value,
bool prefixFlag = false);
Associate the specified value with the specified key in any metric belonging to a category having the specified categoryName, or a category whose name begins with categoryName, as determined by the optionally specified prefixFlag. If prefixFlag is false or is not specified, only those metrics belonging to a category having categoryName will be mapped; otherwise, value will be associated with key for all metrics belonging to any category whose name begins with categoryName. This association applies to existing metrics as well as any subsequently created ones. When a metric is created that matches more than one registered category prefix, it is not specified which supplied value will be associated with key, unless only one of those values is non-null, in which case the unique non-null value is used. The behavior is undefined unless key was previously returned from createUserDataKey.
| Name | Description |
|---|---|
| categoryName | category name, or prefix when prefixFlag is true |
| key | user-data key previously obtained from createUserDataKey |
| value | opaque user-data value to associate |
| prefixFlag | if true, match categories by name prefix |