Class MicrometerMetricsCaptor
java.lang.Object
org.springframework.integration.support.management.micrometer.MicrometerMetricsCaptor
- All Implemented Interfaces:
MetricsCaptor
public class MicrometerMetricsCaptor extends Object implements MetricsCaptor
The Micrometer implementation of
MetricsCaptor
.- Since:
- 5.0.4
- Author:
- Gary Russell, Artem Bilan
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MicrometerMetricsCaptor.AbstractMeter<M extends io.micrometer.core.instrument.Meter>
protected static class
MicrometerMetricsCaptor.MicroCounter
protected static class
MicrometerMetricsCaptor.MicroCounterBuilder
protected static class
MicrometerMetricsCaptor.MicroGauge
protected static class
MicrometerMetricsCaptor.MicroGaugeBuilder
protected static class
MicrometerMetricsCaptor.MicroTimer
protected static class
MicrometerMetricsCaptor.MicroTimerBuilder
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.metrics.MetricsCaptor
MetricsCaptor.CounterBuilder, MetricsCaptor.GaugeBuilder, MetricsCaptor.TimerBuilder
-
Field Summary
Fields Modifier and Type Field Description static String
MICROMETER_CAPTOR_NAME
-
Constructor Summary
Constructors Constructor Description MicrometerMetricsCaptor(io.micrometer.core.instrument.MeterRegistry meterRegistry)
-
Method Summary
Modifier and Type Method Description MetricsCaptor.CounterBuilder
counterBuilder(String name)
Create a counter builder for a counter with the provided name.MetricsCaptor.GaugeBuilder
gaugeBuilder(String name, Object obj, ToDoubleFunction<Object> f)
Create a gauge builder for a gauge with the provided parameters.io.micrometer.core.instrument.MeterRegistry
getMeterRegistry()
static MetricsCaptor
loadCaptor(ApplicationContext applicationContext)
Deprecated.since 5.2.9 in favor of@Import(MicrometerMetricsCaptorRegistrar.class)
; will be removed in 6.0.MeterFacade
removeMeter(MeterFacade facade)
Remove a meter facade.SampleFacade
start()
Start a sample collection.MetricsCaptor.TimerBuilder
timerBuilder(String name)
Create a timer builder for a timer with the provided name.
-
Field Details
-
MICROMETER_CAPTOR_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
MicrometerMetricsCaptor
public MicrometerMetricsCaptor(io.micrometer.core.instrument.MeterRegistry meterRegistry)
-
-
Method Details
-
getMeterRegistry
public io.micrometer.core.instrument.MeterRegistry getMeterRegistry() -
timerBuilder
Description copied from interface:MetricsCaptor
Create a timer builder for a timer with the provided name.- Specified by:
timerBuilder
in interfaceMetricsCaptor
- Parameters:
name
- the name.- Returns:
- the builder.
-
counterBuilder
Description copied from interface:MetricsCaptor
Create a counter builder for a counter with the provided name.- Specified by:
counterBuilder
in interfaceMetricsCaptor
- Parameters:
name
- the name.- Returns:
- the builder.
-
gaugeBuilder
public MetricsCaptor.GaugeBuilder gaugeBuilder(String name, Object obj, ToDoubleFunction<Object> f)Description copied from interface:MetricsCaptor
Create a gauge builder for a gauge with the provided parameters.- Specified by:
gaugeBuilder
in interfaceMetricsCaptor
- Parameters:
name
- the name.obj
- the object with which to invoke the function.f
- the function.- Returns:
- the builder.
-
start
Description copied from interface:MetricsCaptor
Start a sample collection.- Specified by:
start
in interfaceMetricsCaptor
- Returns:
- the sample.
-
removeMeter
Description copied from interface:MetricsCaptor
Remove a meter facade.- Specified by:
removeMeter
in interfaceMetricsCaptor
- Parameters:
facade
- the facade to remove.- Returns:
- the removed facade, or null.
-
loadCaptor
Deprecated.since 5.2.9 in favor of@Import(MicrometerMetricsCaptorRegistrar.class)
; will be removed in 6.0.Add a MicrometerMetricsCaptor to the context if there's a MeterRegistry; if there's already aMetricsCaptor
bean, return that.- Parameters:
applicationContext
- the application context.- Returns:
- the instance.
-