diff --git a/hippo4j-adapter/hippo4j-adapter-hystrix/src/main/java/cn/hippo4j/adapter/hystrix/AbstractHystrixThreadPoolAdapter.java b/hippo4j-adapter/hippo4j-adapter-hystrix/src/main/java/cn/hippo4j/adapter/hystrix/AbstractHystrixThreadPoolAdapter.java index fb6ad924..441a1efb 100644 --- a/hippo4j-adapter/hippo4j-adapter-hystrix/src/main/java/cn/hippo4j/adapter/hystrix/AbstractHystrixThreadPoolAdapter.java +++ b/hippo4j-adapter/hippo4j-adapter-hystrix/src/main/java/cn/hippo4j/adapter/hystrix/AbstractHystrixThreadPoolAdapter.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadPoolExecutor; @@ -67,9 +68,11 @@ public abstract class AbstractHystrixThreadPoolAdapter implements ThreadPoolAdap ThreadPoolAdapterState result = new ThreadPoolAdapterState(); ThreadPoolExecutor threadPoolExecutor = hystrixConsumeExecutor.get(identify); if (threadPoolExecutor != null) { + BlockingQueue blockingQueue = threadPoolExecutor.getQueue(); result.setThreadPoolKey(identify); result.setCoreSize(threadPoolExecutor.getCorePoolSize()); result.setMaximumSize(threadPoolExecutor.getMaximumPoolSize()); + result.setBlockingQueueCapacity(blockingQueue.size() + blockingQueue.remainingCapacity()); return result; } log.warn("[{}] Hystrix thread pool not found.", identify);