pl.allegro.tech.hermes.common.metric.ExecutorMetrics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-common Show documentation
Show all versions of hermes-common Show documentation
Fast and reliable message broker built on top of Kafka.
The newest version!
package pl.allegro.tech.hermes.common.metric;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
public class ExecutorMetrics {
private final MeterRegistry meterRegistry;
public ExecutorMetrics(MeterRegistry meterRegistry) {
this.meterRegistry = meterRegistry;
}
public ExecutorService monitor(ExecutorService executorService, String executorName) {
return ExecutorServiceMetrics.monitor(meterRegistry, executorService, executorName);
}
public ScheduledExecutorService monitor(ScheduledExecutorService scheduledExecutorService, String executorName) {
return ExecutorServiceMetrics.monitor(meterRegistry, scheduledExecutorService, executorName);
}
}