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
  • Field Details

  • Constructor Details

    • MicrometerMetricsCaptor

      public MicrometerMetricsCaptor​(io.micrometer.core.instrument.MeterRegistry meterRegistry)
  • Method Details

    • getMeterRegistry

      public io.micrometer.core.instrument.MeterRegistry getMeterRegistry()
    • timerBuilder

      public MetricsCaptor.TimerBuilder timerBuilder​(java.lang.String name)
      Description copied from interface: MetricsCaptor
      Create a timer builder for a timer with the provided name.
      Specified by:
      timerBuilder in interface MetricsCaptor
      Parameters:
      name - the name.
      Returns:
      the builder.
    • counterBuilder

      public MetricsCaptor.CounterBuilder counterBuilder​(java.lang.String name)
      Description copied from interface: MetricsCaptor
      Create a counter builder for a counter with the provided name.
      Specified by:
      counterBuilder in interface MetricsCaptor
      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: MetricsCaptor
      Create a gauge builder for a gauge with the provided parameters.
      Specified by:
      gaugeBuilder in interface MetricsCaptor
      Parameters:
      name - the name.
      obj - the object with which to invoke the function.
      f - the function.
      Returns:
      the builder.
    • start

      public SampleFacade start()
      Description copied from interface: MetricsCaptor
      Start a sample collection.
      Specified by:
      start in interface MetricsCaptor
      Returns:
      the sample.
    • removeMeter

      public MeterFacade removeMeter​(MeterFacade facade)
      Description copied from interface: MetricsCaptor
      Remove a meter facade.
      Specified by:
      removeMeter in interface MetricsCaptor
      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 a MetricsCaptor bean, return that.
      Parameters:
      applicationContext - the application context.
      Returns:
      the instance.