Search in sources :

Example 6 with InstrumentedThreadFactory

use of com.codahale.metrics.InstrumentedThreadFactory in project graylog2-server by Graylog2.

the class EventLoopGroupFactory method threadFactory.

private ThreadFactory threadFactory(String name, MetricRegistry metricRegistry) {
    final String threadFactoryMetricName = MetricRegistry.name(name, "thread-factory");
    final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("netty-transport-%d").build();
    return new InstrumentedThreadFactory(threadFactory, metricRegistry, threadFactoryMetricName);
}
Also used : InstrumentedThreadFactory(com.codahale.metrics.InstrumentedThreadFactory) ThreadFactory(java.util.concurrent.ThreadFactory) InstrumentedThreadFactory(com.codahale.metrics.InstrumentedThreadFactory) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder)

Aggregations

InstrumentedThreadFactory (com.codahale.metrics.InstrumentedThreadFactory)6 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)4 ThreadFactory (java.util.concurrent.ThreadFactory)4 MetricRegistry (com.codahale.metrics.MetricRegistry)3 InstrumentedExecutorService (com.codahale.metrics.InstrumentedExecutorService)2 ExecutorServiceManager (io.dropwizard.lifecycle.ExecutorServiceManager)2 ExecutorService (java.util.concurrent.ExecutorService)2 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 Gauge (com.codahale.metrics.Gauge)1 InstrumentedScheduledExecutorService (com.codahale.metrics.InstrumentedScheduledExecutorService)1 MetricRegistry.name (com.codahale.metrics.MetricRegistry.name)1 HealthCheckRegistry (com.codahale.metrics.health.HealthCheckRegistry)1 JsonProperty (com.fasterxml.jackson.annotation.JsonProperty)1 JsonTypeName (com.fasterxml.jackson.annotation.JsonTypeName)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Assisted (com.google.inject.assistedinject.Assisted)1 HealthResponderFactory (io.dropwizard.health.response.HealthResponderFactory)1