Class MicrometerMetricsCaptor
java.lang.Object
org.springframework.integration.support.management.micrometer.MicrometerMetricsCaptor
- All Implemented Interfaces:
MetricsCaptor
public class MicrometerMetricsCaptor extends java.lang.Object implements MetricsCaptor
The Micrometer implementation of
MetricsCaptor.- Since:
- 5.0.4
-
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 java.lang.StringMICROMETER_CAPTOR_NAME -
Constructor Summary
Constructors Constructor Description MicrometerMetricsCaptor(io.micrometer.core.instrument.MeterRegistry meterRegistry) -
Method Summary
Modifier and Type Method Description MetricsCaptor.CounterBuildercounterBuilder(java.lang.String name)Create a counter builder for a counter with the provided name.MetricsCaptor.GaugeBuildergaugeBuilder(java.lang.String name, java.lang.Object obj, java.util.function.ToDoubleFunction<java.lang.Object> f)Create a gauge builder for a gauge with the provided parameters.io.micrometer.core.instrument.MeterRegistrygetMeterRegistry()static MetricsCaptorloadCaptor(org.springframework.context.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(java.lang.String name)Create a timer builder for a timer with the provided name.
-
Field Details
-
MICROMETER_CAPTOR_NAME
public static final java.lang.String 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(java.lang.String name, java.lang.Object obj, java.util.function.ToDoubleFunction<java.lang.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 public static MetricsCaptor loadCaptor(org.springframework.context.ApplicationContext applicationContext)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.
-