Class Counter.Builder
- java.lang.Object
-
- org.forgerock.monitoring.api.instrument.Counter.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Counter.Builder
baseUnit(String unit)
Associate a BaseUnit with the CounterCounter.Builder
description(String description)
Associate a description with the CounterCounter.Builder
hierarchicalName(String hierarchicalName)
Counter
register(MeterRegistry registry)
Add the counter to a single registry, or return an existing counter in that registry.Counter.Builder
tag(String key, String value)
Add String-value pair of tags to a CounterCounter.Builder
tags(Iterable<Tag> tags)
Add tags to a Counter in Iterable formCounter.Builder
tags(String... tags)
Add tags to a Counter as an ellipsis of Tag
-
-
-
Method Detail
-
tags
public Counter.Builder tags(String... tags)
Add tags to a Counter as an ellipsis of Tag- Parameters:
tags
- Must be an even number of arguments representing key/value pairs of tags.
-
tags
public Counter.Builder tags(Iterable<Tag> tags)
Add tags to a Counter in Iterable form- Parameters:
tags
- Tags to add to the eventual counter.- Returns:
- The counter builder with added tags.
-
tag
public Counter.Builder tag(String key, String value)
Add String-value pair of tags to a Counter- Parameters:
key
- The tag key.value
- The tag value.- Returns:
- The counter builder with a single added tag.
-
description
public Counter.Builder description(@Nullable String description)
Associate a description with the Counter- Parameters:
description
- Description text of the eventual counter.- Returns:
- The counter builder with added description.
-
baseUnit
public Counter.Builder baseUnit(@Nullable String unit)
Associate a BaseUnit with the Counter- Parameters:
unit
- Base unit of the eventual counter.- Returns:
- The counter builder with added base unit.
-
hierarchicalName
public Counter.Builder hierarchicalName(String hierarchicalName)
- Parameters:
hierarchicalName
- the hierarchical representation of the meter name- Returns:
- The counter builder with added hierarchical name.
-
register
public Counter register(MeterRegistry registry)
Add the counter to a single registry, or return an existing counter in that registry. The returned counter will be unique for each registry, but each registry is guaranteed to only create one counter for the same combination of name and tags.- Parameters:
registry
- A registry to add the counter to, if it doesn't already exist.- Returns:
- A new or existing counter.
-
-