public final class Micrometer extends Object
| Constructor and Description |
|---|
Micrometer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
gaugesOf(InstrumentedPool.PoolMetrics poolMetrics,
String poolName,
io.micrometer.core.instrument.MeterRegistry meterRegistry)
Create a
PoolGaugesBinder and bind to the provided MeterRegistry. |
static <POOLABLE> InstrumentedPool<POOLABLE> |
instrumentedPool(PoolBuilder<POOLABLE,?> poolBuilder,
String poolName,
io.micrometer.core.instrument.MeterRegistry meterRegistry)
Create an
InstrumentedPool starting from the provided PoolBuilder. |
static PoolMetricsRecorder |
recorder(String poolName,
io.micrometer.core.instrument.MeterRegistry meterRegistry)
Create a
PoolMetricsRecorder publishing timers and other meters to a provided MeterRegistry. |
public static <POOLABLE> InstrumentedPool<POOLABLE> instrumentedPool(PoolBuilder<POOLABLE,?> poolBuilder, String poolName, io.micrometer.core.instrument.MeterRegistry meterRegistry)
InstrumentedPool starting from the provided PoolBuilder. The pool publishes metrics to
a Micrometer 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.
The steps involved are as follows:
PoolMetricsRecorder similar to recorder(String, MeterRegistry) PoolBuilder.metricsRecorder(PoolMetricsRecorder) InstrumentedPool via PoolBuilder.buildPool() InstrumentedPool.PoolMetrics via gaugesOf(InstrumentedPool.PoolMetrics, String, MeterRegistry) InstrumentedPool instance POOLABLE - the type of resources in the poolpoolBuilder - a pre-configured PoolBuilder on which to configure a PoolMetricsRecorderpoolName - the tag value to use on the gauges and the recorder's meters to differentiate between poolsmeterRegistry - the registry to use for the gauges and the recorder's metersInstrumentedPool with a Micrometer recorder and with gauges attachedPoolMetersDocumentationpublic static void gaugesOf(InstrumentedPool.PoolMetrics poolMetrics, String poolName, io.micrometer.core.instrument.MeterRegistry meterRegistry)
PoolGaugesBinder and bind to the provided MeterRegistry. This registers gauges around the
InstrumentedPool's InstrumentedPool.PoolMetrics.
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 poolMetrics - the InstrumentedPool.PoolMetrics to turn into gaugespoolName - the tag value to use on the gauges to differentiate between poolsmeterRegistry - the registry to use for the gaugesPoolGaugesBinder,
PoolMetersDocumentation,
instrumentedPool(PoolBuilder, String, MeterRegistry)public static PoolMetricsRecorder recorder(String poolName, io.micrometer.core.instrument.MeterRegistry meterRegistry)
PoolMetricsRecorder publishing timers and other meters to a 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 recorder-specific meters which are:
PoolMetersDocumentation.ALLOCATION PoolMetersDocumentation.DESTROYED, PoolMetersDocumentation.RECYCLED PoolMetersDocumentation.RESET PoolMetersDocumentation.SUMMARY_IDLENESS PoolMetersDocumentation.SUMMARY_LIFETIME poolName - the tag value to use on the gauges and the recorder's meters to differentiate between poolsmeterRegistry - the registry to use for the recorder's metersPoolMetricsRecorderPoolMetersDocumentation,
instrumentedPool(PoolBuilder, String, MeterRegistry)