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 classMicrometerMetricsCaptor.AbstractMeter<M extends io.micrometer.core.instrument.Meter>protected static classMicrometerMetricsCaptor.MicroCounterprotected static classMicrometerMetricsCaptor.MicroCounterBuilderprotected static classMicrometerMetricsCaptor.MicroGaugeprotected static classMicrometerMetricsCaptor.MicroGaugeBuilderprotected static classMicrometerMetricsCaptor.MicroTimerprotected static classMicrometerMetricsCaptor.MicroTimerBuilderNested 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 StringMICROMETER_CAPTOR_NAME -
Constructor Summary
Constructors Constructor Description MicrometerMetricsCaptor(io.micrometer.core.instrument.MeterRegistry meterRegistry) -
Method Summary
Modifier and Type Method Description MetricsCaptor.CounterBuildercounterBuilder(String name)Create a counter builder for a counter with the provided name.MetricsCaptor.GaugeBuildergaugeBuilder(String name, Object obj, ToDoubleFunction<Object> f)Create a gauge builder for a gauge with the provided parameters.io.micrometer.core.instrument.MeterRegistrygetMeterRegistry()static MetricsCaptorloadCaptor(ApplicationContext applicationContext)Deprecated.since 5.2.9 in favor of@Import(MicrometerMetricsCaptorRegistrar.class); will be removed in 6.0.MeterFacaderemoveMeter(MeterFacade facade)Remove a meter facade.SampleFacadestart()Start a sample collection.MetricsCaptor.TimerBuildertimerBuilder(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:MetricsCaptorCreate a timer builder for a timer with the provided name.- Specified by:
timerBuilderin interfaceMetricsCaptor- Parameters:
name- the name.- Returns:
- the builder.
-
counterBuilder
Description copied from interface:MetricsCaptorCreate a counter builder for a counter with the provided name.- Specified by:
counterBuilderin interfaceMetricsCaptor- Parameters:
name- the name.- Returns:
- the builder.
-
gaugeBuilder
public MetricsCaptor.GaugeBuilder gaugeBuilder(String name, Object obj, ToDoubleFunction<Object> f)Description copied from interface:MetricsCaptorCreate a gauge builder for a gauge with the provided parameters.- Specified by:
gaugeBuilderin 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:MetricsCaptorStart a sample collection.- Specified by:
startin interfaceMetricsCaptor- Returns:
- the sample.
-
removeMeter
Description copied from interface:MetricsCaptorRemove a meter facade.- Specified by:
removeMeterin 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 aMetricsCaptorbean, return that.- Parameters:
applicationContext- the application context.- Returns:
- the instance.
-