Package io.micrometer.core.instrument
Class TimeGauge.Builder<T>
java.lang.Object
io.micrometer.core.instrument.TimeGauge.Builder<T>
- Enclosing interface:
- TimeGauge
Fluent builder for time gauges.
-
Method Summary
Modifier and TypeMethodDescriptiondescription(String description)
register(MeterRegistry registry)
Add the time gauge to a single registry, or return an existing time gauge in that registry.strongReference(boolean strong)
Indicates that the time gauge should maintain a strong reference on the object upon which its instantaneous value is determined.
-
Method Details
-
tags
- Parameters:
tags
- Must be an even number of arguments representing key/value pairs of tags.- Returns:
- This time gauge builder.
-
tags
- Parameters:
tags
- Tags to add to the eventual time gauge.- Returns:
- The time gauge builder with added tags.
-
tag
- Parameters:
key
- The tag key.value
- The tag value.- Returns:
- The time gauge builder with a single added tag.
-
description
- Parameters:
description
- Description text of the eventual time gauge.- Returns:
- The time gauge builder with added description.
-
strongReference
Indicates that the time gauge should maintain a strong reference on the object upon which its instantaneous value is determined.- Parameters:
strong
- Whether or not to maintain a strong reference on the time gauged object.- Returns:
- The time gauge builder with altered strong reference semantics.
- Since:
- 1.7.0
-
register
Add the time gauge to a single registry, or return an existing time gauge in that registry. The returned time gauge will be unique for each registry, but each registry is guaranteed to only create one time gauge for the same combination of name and tags.- Parameters:
registry
- A registry to add the time gauge to, if it doesn't already exist.- Returns:
- A new or existing time gauge.
-