jvm命令中LIVE-COUNT命名有问题,应该是PEAK-COUNT,并增加DEADLOCK-COUNT

pull/95/head
bohr.qiu 6 years ago
parent b697c99904
commit af45b299a4

@ -206,9 +206,17 @@ public class JvmCommand extends AnnotatedCommand {
private Element drawThreadTable(TableElement table) {
table.row("COUNT", "" + threadMXBean.getThreadCount())
.row("DAEMON-COUNT", "" + threadMXBean.getDaemonThreadCount())
.row("LIVE-COUNT", "" + threadMXBean.getPeakThreadCount())
.row("STARTED-COUNT", "" + threadMXBean.getTotalStartedThreadCount());
.row("PEAK-COUNT", "" + threadMXBean.getPeakThreadCount())
.row("STARTED-COUNT", "" + threadMXBean.getTotalStartedThreadCount())
.row("DEADLOCK-COUNT","" + getDeadlockedThreadsCount(threadMXBean));
return table;
}
private int getDeadlockedThreadsCount(ThreadMXBean threads) {
final long[] ids = threads.findDeadlockedThreads();
if (ids == null) {
return 0;
} else {
return ids.length;
}
}
}

@ -84,8 +84,10 @@ $ jvm
THREAD COUNT 16
DAEMON-COUNT 10
LIVE-COUNT 18
PEAK-COUNT 18
STARTED-COUNT 19
DEADLOCK-COUNT 0
Affect cost in 2 ms.
```

Loading…
Cancel
Save