morningman commented on a change in pull request #5110:
URL: https://github.com/apache/incubator-doris/pull/5110#discussion_r545824488
##########
File path: fe/fe-core/src/main/java/org/apache/doris/monitor/jvm/JvmStats.java
##########
@@ -82,7 +83,27 @@ public static JvmStats jvmStats() {
}
Mem mem = new Mem(heapCommitted, heapUsed, heapMax, nonHeapCommitted,
nonHeapUsed,
Collections.unmodifiableList(pools));
- Threads threads = new Threads(threadMXBean.getThreadCount(),
threadMXBean.getPeakThreadCount());
+
+ int threadsNew = 0;
+ int threadsRunnable = 0;
+ int threadsBlocked = 0;
+ int threadsWaiting = 0;
+ int threadsTimedWaiting = 0;
+ int threadsTerminated = 0;
+ long threadIds[] = threadMXBean.getAllThreadIds();
+ for (ThreadInfo threadInfo : threadMXBean.getThreadInfo(threadIds, 0))
{
+ if (threadInfo == null) continue; // race protection
+ switch (threadInfo.getThreadState()) {
+ case NEW: threadsNew++; break;
+ case RUNNABLE: threadsRunnable++; break;
+ case BLOCKED: threadsBlocked++; break;
+ case WAITING: threadsWaiting++; break;
+ case TIMED_WAITING: threadsTimedWaiting++; break;
+ case TERMINATED: threadsTerminated++; break;
Review comment:
Missing default?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]