diff --git a/src/main/java/org/elasticsearch/threadpool/ThreadPool.java b/src/main/java/org/elasticsearch/threadpool/ThreadPool.java index ebfc751a942..12a7853ac84 100644 --- a/src/main/java/org/elasticsearch/threadpool/ThreadPool.java +++ b/src/main/java/org/elasticsearch/threadpool/ThreadPool.java @@ -139,17 +139,19 @@ public class ThreadPool extends AbstractComponent { int queue = -1; int active = -1; long rejected = -1; + int largest = -1; if (holder.executor instanceof ThreadPoolExecutor) { ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) holder.executor; threads = threadPoolExecutor.getPoolSize(); queue = threadPoolExecutor.getQueue().size(); active = threadPoolExecutor.getActiveCount(); + largest = threadPoolExecutor.getLargestPoolSize(); RejectedExecutionHandler rejectedExecutionHandler = threadPoolExecutor.getRejectedExecutionHandler(); if (rejectedExecutionHandler instanceof XRejectedExecutionHandler) { rejected = ((XRejectedExecutionHandler) rejectedExecutionHandler).rejected(); } } - stats.add(new ThreadPoolStats.Stats(name, threads, queue, active, rejected)); + stats.add(new ThreadPoolStats.Stats(name, threads, queue, active, rejected, largest)); } return new ThreadPoolStats(stats); } diff --git a/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java b/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java index 929860a2985..11e6b356c0f 100644 --- a/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java +++ b/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java @@ -42,17 +42,19 @@ public class ThreadPoolStats implements Streamable, ToXContent, Iterable