From 4768e6e458ec69b37de77ee9a928ea896874ce51 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 28 Nov 2024 15:22:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=BF=AB=E7=85=A7=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8serverId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1299986501828608]打印线程快照时增加服务器serverId http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1299986501828608 --- .../module/tenant/api/healthcheck/ThreadDumpApi.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/healthcheck/ThreadDumpApi.java b/src/main/java/neatlogic/module/tenant/api/healthcheck/ThreadDumpApi.java index 7d81706b..03ba8e87 100644 --- a/src/main/java/neatlogic/module/tenant/api/healthcheck/ThreadDumpApi.java +++ b/src/main/java/neatlogic/module/tenant/api/healthcheck/ThreadDumpApi.java @@ -15,14 +15,15 @@ along with this program. If not, see .*/ package neatlogic.module.tenant.api.healthcheck; +import com.alibaba.fastjson.JSONObject; import neatlogic.framework.asynchronization.threadlocal.RequestContext; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.auth.label.ADMIN; +import neatlogic.framework.common.config.Config; import neatlogic.framework.restful.annotation.Description; import neatlogic.framework.restful.annotation.OperationType; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import com.alibaba.fastjson.JSONObject; import org.springframework.stereotype.Service; import java.io.IOException; @@ -59,7 +60,7 @@ public class ThreadDumpApi extends PrivateApiComponentBase { private static void dumpTraces(ThreadMXBean mxBean, Map threadInfoMap, Writer writer) throws IOException { Map stacks = Thread.getAllStackTraces(); long now = System.currentTimeMillis(); - writer.write("=================" + stacks.size() + " thread of " + RequestContext.get().getRequest().getLocalAddr() + " at " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(now)) + " start.=================\n\n"); + writer.write("=================" + stacks.size() + " thread of " + RequestContext.get().getRequest().getLocalAddr() + " at " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(now)) + " start.serverId is " + Config.SCHEDULE_SERVER_ID + "=================\n\n"); for (Map.Entry entry : stacks.entrySet()) { Thread thread = entry.getKey(); writer.write("\"" + thread.getName() + "\" prio=" + thread.getPriority() + " tid=" + thread.getId() + " " + thread.getState() + " " + (thread.isDaemon() ? "deamon" : "worker")); -- Gitee