public final class PoolGaugesBinder extends Object implements io.micrometer.core.instrument.binder.MeterBinder
MeterBinder that registers Micrometer gauges around a InstrumentedPool's InstrumentedPool.PoolMetrics,
publishing to the provided MeterRegistry. One can differentiate between pools thanks to the provided poolName,
which will be set on all meters as the value for the PoolMetersDocumentation.CommonTags.POOL_NAME tag.
PoolMetersDocumentation include the gauges which are:
PoolMetersDocumentation.ACQUIRED PoolMetersDocumentation.ALLOCATED, PoolMetersDocumentation.IDLE PoolMetersDocumentation.PENDING_ACQUIRE
Note that this doesn't cover metrics that show evolution of the pool's state and timings, which are separately
measured using a PoolMetricsRecorder provided when building the pool.
See Micrometer.recorder(String, MeterRegistry), as well as Micrometer.instrumentedPool(PoolBuilder, String, MeterRegistry)
for a solution that covers both.
| Constructor and Description |
|---|
PoolGaugesBinder(InstrumentedPool.PoolMetrics poolMetrics,
String poolName)
Create a
PoolGaugesBinder. |
| Modifier and Type | Method and Description |
|---|---|
void |
bindTo(io.micrometer.core.instrument.MeterRegistry meterRegistry) |
public PoolGaugesBinder(InstrumentedPool.PoolMetrics poolMetrics, String poolName)
PoolGaugesBinder.poolMetrics - the InstrumentedPool.PoolMetrics to turn into gaugespoolName - the tag value to use on the gauges to differentiate between poolsPoolMetersDocumentation