/** * <p>Returns whether this thread pool is low on threads.</p> * <p>The current formula is:</p> * <pre> * maxThreads - threads + idleThreads - queueSize <= lowThreadsThreshold * </pre> * * @return whether the pool is low on threads * @see #getLowThreadsThreshold() */ @Override @ManagedAttribute(value = "thread pool is low on threads", readonly = true) public boolean isLowOnThreads() { return getMaxThreads() - getThreads() + getIdleThreads() - getQueueSize() <= getLowThreadsThreshold(); }
@Override public Long getInstantValue() { return Long.valueOf(this.httpThreadPool.getQueueSize()); } }
@Managed(description = "size of the job queue") public int getQueueSize() { return threadPool.getQueueSize(); }
/** * <p>Returns whether this thread pool is low on threads.</p> * <p>The current formula is:</p> * <pre> * maxThreads - threads + idleThreads - queueSize <= lowThreadsThreshold * </pre> * * @return whether the pool is low on threads * @see #getLowThreadsThreshold() */ @Override @ManagedAttribute(value = "thread pool is low on threads", readonly = true) public boolean isLowOnThreads() { return getMaxThreads() - getThreads() + getIdleThreads() - getQueueSize() <= getLowThreadsThreshold(); }