提交 9caaf68f 编写于 作者: Z zhourui

ctl -hs 生成server.dump()文件

上级 2e903dbd
......@@ -37,31 +37,33 @@ public class HttpStatus extends Thread {
bean.getTotalStartedThreadCount(), bean.getThreadCount(), bean.getPeakThreadCount(),
bean.getDaemonThreadCount(), deadLockedCount));
if (BooleanUtils.isTrue(Servers.centerServerIsRunning())) {
String file = "centerServer_" + DateTools.compact(new Date()) + ".txt";
File file = new File(Config.dir_logs(true),
"centerServer_" + DateTools.compact(new Date()) + ".txt");
list.add(String.format(" +++ center server thread pool size:%d, idle:%d, detail:%s.",
Servers.centerServer.getThreadPool().getThreads(),
Servers.centerServer.getThreadPool().getIdleThreads(), file));
try (FileOutputStream stream = new FileOutputStream(new File(Config.dir_logs(true), file));
Servers.centerServer.getThreadPool().getIdleThreads(), file.getAbsolutePath()));
try (FileOutputStream stream = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(stream)) {
Servers.centerServer.dump(writer);
}
}
if (BooleanUtils.isTrue(Servers.applicationServerIsRunning())) {
String file = "applicationServer_" + DateTools.compact(new Date()) + ".txt";
File file = new File(Config.dir_logs(true),
"applicationServer_" + DateTools.compact(new Date()) + ".txt");
list.add(String.format(" +++ application server thread pool size:%d, idle:%d, detail:%s.",
Servers.applicationServer.getThreadPool().getThreads(),
Servers.applicationServer.getThreadPool().getIdleThreads(), file));
try (FileOutputStream stream = new FileOutputStream(new File(Config.dir_logs(true), file));
Servers.applicationServer.getThreadPool().getIdleThreads(), file.getAbsolutePath()));
try (FileOutputStream stream = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(stream)) {
Servers.applicationServer.dump(writer);
}
}
if (BooleanUtils.isTrue(Servers.webServerIsRunning())) {
String file = "webServer_" + DateTools.compact(new Date()) + ".txt";
File file = new File(Config.dir_logs(true), "webServer_" + DateTools.compact(new Date()) + ".txt");
list.add(String.format(" +++ web server thread pool size:%d, idle:%d, detail:%s.",
Servers.webServer.getThreadPool().getThreads(),
Servers.webServer.getThreadPool().getIdleThreads(), file));
try (FileOutputStream stream = new FileOutputStream(new File(Config.dir_logs(true), file));
Servers.webServer.getThreadPool().getIdleThreads(), file.getAbsolutePath()));
try (FileOutputStream stream = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(stream)) {
Servers.webServer.dump(writer);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册