@Override public int activeThreadCount() { if (server == null) { return 0; } return server.getThreadPool().getThreads() - server.getThreadPool().getIdleThreads(); }
public static int getServerThreads() { return server.getThreadPool().getThreads() - server.getThreadPool().getIdleThreads(); }
@Override public void run() { ready.countDown(); try { start.await(); assertEquals("a:b\nc:d\n", readOutput(new URL(baseUrl, "/echo?a=b&c=d"))); int serverThreads = server.webServer.getThreadPool().getThreads(); assertTrue("More threads are started than expected, Server Threads count: " + serverThreads, serverThreads <= MAX_THREADS); System.out.println("Number of threads = " + serverThreads + " which is less or equal than the max = " + MAX_THREADS); } catch (Exception e) { // do nothing } } });
public static int getServerThreads() { return server.getThreadPool().getThreads() - server.getThreadPool().getIdleThreads(); }
@Override public int getJettyCNSRequestHandlerPoolSize() { return CMB.cnsServer.getThreadPool().getThreads(); }
@Override public int getJettyCQSRequestHandlerPoolSize() { return CMB.cqsServer.getThreadPool().getThreads(); }
protected void startServer() { try { writePid2File(); super.start(); LOGGER.info("Current thread: {} | Idle thread: {}", super.getThreadPool().getThreads(), super.getThreadPool().getIdleThreads()); super.join(); } catch (final Throwable e) { // NANO-386: fixed Address already in use bug LOGGER.error("Bootstrap server error: {}", e.getMessage()); System.exit(1); } }
@Override public int activeThreadCount() { if (server == null) { return 0; } return server.getThreadPool().getThreads() - server.getThreadPool().getIdleThreads(); }
@Override public boolean isLowOnResources() { ThreadPool serverThreads = _server.getThreadPool(); if(serverThreads.isLowOnThreads()) { reason ="Server low on threads: "+serverThreads.getThreads()+", idleThreads:"+serverThreads.getIdleThreads(); return true; } for(Connector connector : getMonitoredConnectors()) { Executor executor = connector.getExecutor(); if (executor instanceof ThreadPool && executor!=serverThreads) { ThreadPool connectorThreads=(ThreadPool)executor; if (connectorThreads.isLowOnThreads()) { reason ="Connector low on threads: "+connectorThreads; return true; } } } return false; }