Package io.micrometer.core.instrument
Class MultiGauge
java.lang.Object
io.micrometer.core.instrument.MultiGauge
A virtual meter that manages a dynamic set of gauges with a common name and common
tags.
A MultiGauge is not itself a Meter; it creates and removes individual
Gauge meters as rows are registered. Each row contributes unique tags and a
value function. Re-registering rows reconciles the gauges currently managed by this
instance with the supplied rows.
- Since:
- 1.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFluent builder for multi-gauges.static class -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiGauge.Buildervoidregister(Iterable<? extends MultiGauge.Row<?>> rows) Register rows for this multi-gauge without replacing rows that have already been registered with the same tags.voidregister(Iterable<? extends MultiGauge.Row<?>> rows, boolean overwrite) Register rows for this multi-gauge.
-
Method Details
-
builder
- Parameters:
name- The gauge's name.- Returns:
- A new gauge builder.
-
register
Register rows for this multi-gauge without replacing rows that have already been registered with the same tags. Rows that are no longer present are removed.- Parameters:
rows- rows to register
-
register
Register rows for this multi-gauge.Each row is registered as a gauge using this multi-gauge's common name and tags, combined with the row's unique tags. When
overwriteistrue, rows that were previously registered with the same tags are replaced with the latest values. Whenoverwriteisfalse, previously registered rows with the same tags are left unchanged. Rows that are no longer present are removed.- Parameters:
rows- rows to registeroverwrite- whether to replace rows that have already been registered with the same tags
-