Class ThreadPoolTaskExecutorMetrics

  • All Implemented Interfaces:
    io.micrometer.core.instrument.binder.MeterBinder

    @NonNullApi
    @NonNullFields
    public class ThreadPoolTaskExecutorMetrics
    extends java.lang.Object
    implements io.micrometer.core.instrument.binder.MeterBinder
    Monitors the status of ThreadPoolTaskExecutor pools. Does not record timings on operations executed in the ExecutorService, as this requires the instance to be wrapped. Timings are provided separately by wrapping the executor service with TimedThreadPoolTaskExecutor.
    • Constructor Summary

      Constructors 
      Constructor Description
      ThreadPoolTaskExecutorMetrics​(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor executor, java.lang.String name, java.lang.Iterable<io.micrometer.core.instrument.Tag> tags)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bindTo​(io.micrometer.core.instrument.MeterRegistry registry)  
      static java.util.concurrent.Executor monitor​(io.micrometer.core.instrument.MeterRegistry registry, java.lang.String name, io.micrometer.core.instrument.Tag... tags)
      Returns a new ThreadPoolTaskExecutor with recorded metrics.
      static org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor monitor​(io.micrometer.core.instrument.MeterRegistry registry, java.lang.String name, java.lang.Iterable<io.micrometer.core.instrument.Tag> tags)
      Returns a new ThreadPoolTaskExecutor with recorded metrics.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThreadPoolTaskExecutorMetrics

        public ThreadPoolTaskExecutorMetrics​(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor executor,
                                             java.lang.String name,
                                             java.lang.Iterable<io.micrometer.core.instrument.Tag> tags)
    • Method Detail

      • monitor

        public static org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor monitor​(io.micrometer.core.instrument.MeterRegistry registry,
                                                                                               java.lang.String name,
                                                                                               java.lang.Iterable<io.micrometer.core.instrument.Tag> tags)
        Returns a new ThreadPoolTaskExecutor with recorded metrics.
        Parameters:
        registry - The registry to bind metrics to.
        name - The name prefix of the metrics.
        tags - Tags to apply to all recorded metrics.
        Returns:
        The instrumented executor, proxied.
      • monitor

        public static java.util.concurrent.Executor monitor​(io.micrometer.core.instrument.MeterRegistry registry,
                                                            java.lang.String name,
                                                            io.micrometer.core.instrument.Tag... tags)
        Returns a new ThreadPoolTaskExecutor with recorded metrics.
        Parameters:
        registry - The registry to bind metrics to.
        name - The name prefix of the metrics.
        tags - Tags to apply to all recorded metrics.
        Returns:
        The instrumented executor, proxied.
      • bindTo

        public void bindTo​(io.micrometer.core.instrument.MeterRegistry registry)
        Specified by:
        bindTo in interface io.micrometer.core.instrument.binder.MeterBinder