Class Counter.Builder
java.lang.Object
org.forgerock.monitoring.api.instrument.Counter.Builder
- Enclosing interface:
- Counter
Fluent builder for counters.
-
Method Summary
Modifier and TypeMethodDescriptionAssociate a BaseUnit with the Counterdescription
(String description) Associate a description with the CounterhierarchicalName
(String hierarchicalName) register
(MeterRegistry registry) Add the counter to a single registry, or return an existing counter in that registry.Add String-value pair of tags to a CounterAdd tags to a Counter in Iterable formAdd tags to a Counter as an ellipsis of Tag
-
Method Details
-
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
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
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
Associate a description with the Counter- Parameters:
description
- Description text of the eventual counter.- Returns:
- The counter builder with added description.
-
baseUnit
Associate a BaseUnit with the Counter- Parameters:
unit
- Base unit of the eventual counter.- Returns:
- The counter builder with added base unit.
-
hierarchicalName
- Parameters:
hierarchicalName
- the hierarchical representation of the meter name- Returns:
- The counter builder with added hierarchical name.
-
register
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.
-