From 23fabc6ef106d9681666bb8646cb9b6409317fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E5=8F=B0?= Date: Mon, 2 Aug 2021 21:40:32 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E5=8A=A8=E6=80=81=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0=E5=88=B7=E6=96=B0=E6=97=B6=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E6=B1=A0=20ID.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../threadpool/starter/core/ThreadPoolDynamicRefresh.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java index 529087fb..c502285a 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java +++ b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java @@ -32,6 +32,7 @@ public class ThreadPoolDynamicRefresh { public static void refreshDynamicPool(String threadPoolId, Integer coreSize, Integer maxSize, Integer queueType, Integer capacity, Integer keepAliveTime, Integer rejectedType) { ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getPool(); printLog("[🔥] Original thread pool. ", + threadPoolId, executor.getCorePoolSize(), executor.getMaximumPoolSize(), queueType, @@ -43,6 +44,7 @@ public class ThreadPoolDynamicRefresh { ThreadPoolExecutor afterExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getPool(); printLog("[🚀] Changed thread pool. ", + threadPoolId, afterExecutor.getCorePoolSize(), afterExecutor.getMaximumPoolSize(), queueType, @@ -51,8 +53,8 @@ public class ThreadPoolDynamicRefresh { rejectedType); } - private static void printLog(String prefixMsg, Integer coreSize, Integer maxSize, Integer queueType, Integer capacity, Long keepAliveTime, Integer rejectedType) { - log.info("{} coreSize :: {}, maxSize :: {}, queueType :: {}, capacity :: {}, keepAliveTime :: {}, rejectedType:: {}", prefixMsg, coreSize, maxSize, queueType, capacity, keepAliveTime, rejectedType); + private static void printLog(String tpId, String prefixMsg, Integer coreSize, Integer maxSize, Integer queueType, Integer capacity, Long keepAliveTime, Integer rejectedType) { + log.info("{} :: {}, coreSize :: {}, maxSize :: {}, queueType :: {}, capacity :: {}, keepAliveTime :: {}, rejectedType:: {}", tpId, prefixMsg, coreSize, maxSize, queueType, capacity, keepAliveTime, rejectedType); } public static void changePoolInfo(ThreadPoolExecutor executor, Integer coreSize, Integer maxSize, Integer queueType, Integer capacity, Integer keepAliveTime, Integer rejectedType) {