use of sun.tools.jstat.JStatLogger in project jdk8u_jdk by JetBrains.
the class JCmd method listCounters.
private static void listCounters(String pid) {
// Code from JStat (can't call it directly since it does System.exit)
VmIdentifier vmId = null;
try {
vmId = new VmIdentifier(pid);
} catch (URISyntaxException e) {
System.err.println("Malformed VM Identifier: " + pid);
return;
}
try {
MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(vmId);
MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(vmId, -1);
JStatLogger logger = new JStatLogger(monitoredVm);
// all names
logger.printSnapShot(// all names
"\\w*", // comparator
new AscendingMonitorComparator(), // not verbose
false, // show unsupported
true, System.out);
monitoredHost.detach(monitoredVm);
} catch (MonitorException ex) {
ex.printStackTrace();
}
}
Aggregations