T
- The type of the state object from which the gauge value is extracted.public static class Gauge.Builder<T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Gauge.Builder<T> |
baseUnit(java.lang.String unit) |
Gauge.Builder<T> |
description(java.lang.String description) |
Gauge |
register(MeterRegistry registry)
Add the gauge to a single registry, or return an existing gauge in that registry.
|
Gauge.Builder<T> |
tag(java.lang.String key,
java.lang.String value) |
Gauge.Builder<T> |
tags(java.lang.Iterable<Tag> tags) |
Gauge.Builder<T> |
tags(java.lang.String... tags) |
public Gauge.Builder<T> tags(java.lang.String... tags)
tags
- Must be an even number of arguments representing key/value pairs of tags.public Gauge.Builder<T> tags(java.lang.Iterable<Tag> tags)
tags
- Tags to add to the eventual meter.public Gauge.Builder<T> tag(java.lang.String key, java.lang.String value)
key
- The tag key.value
- The tag value.public Gauge.Builder<T> description(@Nullable java.lang.String description)
description
- Description text of the eventual gauge.public Gauge.Builder<T> baseUnit(@Nullable java.lang.String unit)
unit
- Base unit of the eventual gauge.public Gauge register(MeterRegistry registry)
registry
- A registry to add the gauge to, if it doesn't already exist.