link start!
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.spy.SpyWriter
|
||||
*/
|
||||
package com.tridium.platform.qnx.se;
|
||||
|
||||
import java.lang.management.ClassLoadingMXBean;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryPoolMXBean;
|
||||
import java.lang.management.MemoryUsage;
|
||||
import java.lang.management.ThreadMXBean;
|
||||
import java.util.List;
|
||||
import javax.baja.spy.SpyWriter;
|
||||
|
||||
public class QnxJmxInfo {
|
||||
public static int dumpJmxInfo(SpyWriter spyWriter) {
|
||||
spyWriter.startTable(false);
|
||||
spyWriter.trTitle((Object)"JMX Thread Info", 1);
|
||||
spyWriter.endTable();
|
||||
spyWriter.w((Object)"<pre>\n");
|
||||
spyWriter.write("\nJMX Thread Info\n");
|
||||
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
|
||||
spyWriter.write("\tpeak thread count " + threadMXBean.getPeakThreadCount() + '\n');
|
||||
spyWriter.write("\tcurrent thread count " + threadMXBean.getThreadCount() + '\n');
|
||||
spyWriter.write("\ttotal started count " + threadMXBean.getTotalStartedThreadCount() + '\n');
|
||||
spyWriter.write("\nJMX Class Loading Info\n");
|
||||
ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();
|
||||
spyWriter.write("\tloaded class " + classLoadingMXBean.getLoadedClassCount() + '\n');
|
||||
spyWriter.write("\ttotal loaded " + classLoadingMXBean.getTotalLoadedClassCount() + '\n');
|
||||
spyWriter.write("\tunloaded " + classLoadingMXBean.getUnloadedClassCount() + '\n');
|
||||
spyWriter.write("\nJMX Memory Pool Info\n\n");
|
||||
List<MemoryPoolMXBean> list = ManagementFactory.getMemoryPoolMXBeans();
|
||||
int n = 0;
|
||||
while (n < list.size()) {
|
||||
MemoryPoolMXBean memoryPoolMXBean = list.get(n);
|
||||
MemoryUsage memoryUsage = memoryPoolMXBean.getUsage();
|
||||
MemoryUsage memoryUsage2 = memoryPoolMXBean.getPeakUsage();
|
||||
spyWriter.write(memoryPoolMXBean.getName() + '\n');
|
||||
spyWriter.write("\tcurrent " + memoryUsage + '\n');
|
||||
spyWriter.write("\tpeak " + memoryUsage2 + "\n\n");
|
||||
++n;
|
||||
}
|
||||
spyWriter.w((Object)"</pre>\n");
|
||||
spyWriter.flush();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user