Class FunctionCounter.Builder<T>
java.lang.Object
org.forgerock.monitoring.api.instrument.FunctionCounter.Builder<T>
- Type Parameters:
T
- The type of the state object from which the counter value is extracted.
- Enclosing interface:
- FunctionCounter
Fluent builder for function counters.
-
Method Summary
Modifier and TypeMethodDescriptionAssociate a BaseUnit with the FunctionCounter.description
(String description) Associate a description with the FunctionCounter.hierarchicalName
(String hierarchicalName) Set the hierarchical name of the FunctionCounter.register
(MeterRegistry registry) Add the function counter to a single registry, or return an existing function counter in that registry.Add String-value pair of tags to a FunctionCounter.Add tags to a FunctionCounter in Iterable form.Add tags to a FunctionCounter as an ellipsis of Tag.
-
Method Details
-
tags
Add tags to a FunctionCounter as an ellipsis of Tag.- Parameters:
tags
- Must be an even number of arguments representing key/value pairs of tags.- Returns:
- The function counter builder with added tags.
-
tags
Add tags to a FunctionCounter in Iterable form.- Parameters:
tags
- Tags to add to the eventual counter.- Returns:
- The function counter builder with added tags.
-
tag
Add String-value pair of tags to a FunctionCounter.- Parameters:
key
- The tag key.value
- The tag value.- Returns:
- The function counter builder with a single added tag.
-
description
Associate a description with the FunctionCounter.- Parameters:
description
- Description text of the eventual function counter.- Returns:
- The function counter builder with added description.
-
baseUnit
Associate a BaseUnit with the FunctionCounter.- Parameters:
unit
- Base unit of the eventual counter.- Returns:
- The function counter builder with added base unit.
-
hierarchicalName
Set the hierarchical name of the FunctionCounter.- Parameters:
hierarchicalName
- the hierarchical representation of the meter name.- Returns:
- The function counter builder with added hierarchical name.
-
register
Add the function counter to a single registry, or return an existing function counter in that registry. The returned function counter will be unique for each registry, but each registry is guaranteed to only create one function counter for the same combination of name and tags.- Parameters:
registry
- A registry to add the function counter to, if it doesn't already exist.- Returns:
- A new or existing function counter.
-