Package io.micrometer.spring.async
Class ThreadPoolTaskExecutorMetrics
- java.lang.Object
-
- io.micrometer.spring.async.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 ofThreadPoolTaskExecutor
pools. Does not record timings on operations executed in theExecutorService
, as this requires the instance to be wrapped. Timings are provided separately by wrapping the executor service withTimedThreadPoolTaskExecutor
.
-
-
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 newThreadPoolTaskExecutor
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 newThreadPoolTaskExecutor
with recorded metrics.
-
-
-
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 newThreadPoolTaskExecutor
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 newThreadPoolTaskExecutor
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 interfaceio.micrometer.core.instrument.binder.MeterBinder
-
-