Search in sources :

Example 6 with InstrumentedQueuedThreadPool

use of com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool in project dropwizard by dropwizard.

the class DefaultServerFactory method buildAdminConnectors.

private List<Connector> buildAdminConnectors(MetricRegistry metricRegistry, Server server) {
    // threadpool is shared between all the connectors, so it should be managed by the server instead of the
    // individual connectors
    final QueuedThreadPool threadPool = new InstrumentedQueuedThreadPool(metricRegistry, adminMaxThreads, adminMinThreads);
    threadPool.setName("dw-admin");
    server.addBean(threadPool);
    final List<Connector> connectors = new ArrayList<>();
    for (ConnectorFactory factory : adminConnectors) {
        final Connector connector = factory.build(server, metricRegistry, "admin", threadPool);
        if (connector instanceof ContainerLifeCycle) {
            connector.unmanage(threadPool);
        }
        connectors.add(connector);
    }
    return connectors;
}
Also used : Connector(org.eclipse.jetty.server.Connector) InstrumentedQueuedThreadPool(com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool) HttpConnectorFactory(io.dropwizard.jetty.HttpConnectorFactory) ConnectorFactory(io.dropwizard.jetty.ConnectorFactory) InstrumentedQueuedThreadPool(com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool) QueuedThreadPool(org.eclipse.jetty.util.thread.QueuedThreadPool) ArrayList(java.util.ArrayList) ContainerLifeCycle(org.eclipse.jetty.util.component.ContainerLifeCycle)

Aggregations

InstrumentedQueuedThreadPool (com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool)5 Server (org.eclipse.jetty.server.Server)4 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)4 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)4 Connector (org.eclipse.jetty.server.Connector)3 HealthCheckRegistry (com.codahale.metrics.health.HealthCheckRegistry)2 InetSocketAddress (java.net.InetSocketAddress)2 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)2 ServerConnector (org.eclipse.jetty.server.ServerConnector)2 ThreadPool (org.eclipse.jetty.util.thread.ThreadPool)2 Bean (org.springframework.context.annotation.Bean)2 Order (org.springframework.core.annotation.Order)2 InstrumentedConnectionFactory (com.codahale.metrics.jetty9.InstrumentedConnectionFactory)1 InstrumentedHandler (com.codahale.metrics.jetty9.InstrumentedHandler)1 AdminServlet (com.codahale.metrics.servlets.AdminServlet)1 InstrumentedHandler (com.kixeye.chassis.transport.http.InstrumentedHandler)1 MessageSerDe (com.kixeye.chassis.transport.serde.MessageSerDe)1 HealthServlet (com.kixeye.chassis.transport.shared.HealthServlet)1 SwaggerRegistry (com.kixeye.chassis.transport.swagger.SwaggerRegistry)1 ConnectorFactory (io.dropwizard.jetty.ConnectorFactory)1