Class FunctionCounter.Builder<T>
java.lang.Object
io.micrometer.core.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 TypeMethodDescriptionUse this if the unit is not time.description(@Nullable String description) register(MeterRegistry registry) Register the function counter with the registry.
-
Method Details
-
tags
- Parameters:
tags- Must be an even number of arguments representing key/value pairs of tags.- Returns:
- The function counter builder with added tags.
-
tags
- Parameters:
tags- Tags to add to the eventual function counter.- Returns:
- The function counter builder with added tags.
-
tag
- Parameters:
key- The tag key.value- The tag value.- Returns:
- The function counter builder with a single added tag.
-
description
- Parameters:
description- Description text of the eventual function counter.- Returns:
- The function counter builder with added description.
-
baseUnit
Use this if the unit is not time. If the unit is time, use a time-based builder instead:FunctionCounter.builder(String, Object, ToDoubleFunction, TimeUnit).- Parameters:
unit- Base unit of the eventual counter.- Returns:
- The counter builder with added base unit.
-
register
Register the function counter with the registry. If a meter with the same name and tags is already registered, the existing function counter is returned and this registration call has no effect.- Parameters:
registry- Registry to register the function counter with.- Returns:
- The registered function counter.
-