system_out_제거
This commit is contained in:
@@ -209,9 +209,9 @@ public class HostStatusService implements InitializingBean {
|
|||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
HostStatusService service = new HostStatusService();
|
HostStatusService service = new HostStatusService();
|
||||||
service.afterPropertiesSet();
|
service.afterPropertiesSet();
|
||||||
System.out.println("CPU : " + service.getCpuPercentage());
|
// System.out.println("CPU : " + service.getCpuPercentage());
|
||||||
System.out.println("MEMORY : " + service.getMemoryPercentage());
|
// System.out.println("MEMORY : " + service.getMemoryPercentage());
|
||||||
System.out.println("DISK(/log) : " + service.getDiskPercentage("/log"));
|
// System.out.println("DISK(/log) : " + service.getDiskPercentage("/log"));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ public class SingleQueueMonitoringForActiveMq implements JMXMonitoring {
|
|||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
|
||||||
monitoring.init(properties);
|
monitoring.init(properties);
|
||||||
System.out.println(monitoring.getState(""));
|
// System.out.println(monitoring.getState(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -121,7 +121,7 @@ public class SingleQueueMonitoringForWebLogic implements JMXMonitoring {
|
|||||||
properties.put("LOCAL_MBEAN_SERVER_PASSWORD", "welcome1!");
|
properties.put("LOCAL_MBEAN_SERVER_PASSWORD", "welcome1!");
|
||||||
|
|
||||||
monitoring.init(properties);
|
monitoring.init(properties);
|
||||||
System.out.println(monitoring.getState("mccSvr11"));
|
// System.out.println(monitoring.getState("mccSvr11"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -84,7 +84,7 @@ public class SingleServerMonitoringForWebLogic implements JMXMonitoring {
|
|||||||
properties.put("LOCAL_MBEAN_SERVER_PASSWORD", "welcome1!");
|
properties.put("LOCAL_MBEAN_SERVER_PASSWORD", "welcome1!");
|
||||||
|
|
||||||
monitoring.init(properties);
|
monitoring.init(properties);
|
||||||
System.out.println(monitoring.getState("mcuSvr11"));
|
// System.out.println(monitoring.getState("mcuSvr11"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,16 +34,11 @@ public class WindowsSystemMon {
|
|||||||
|
|
||||||
private static void printSystemUsage() {
|
private static void printSystemUsage() {
|
||||||
OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
|
OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
|
||||||
System.out.println(
|
// System.out.println("CPU Usage : " + String.format("%.2f", getBeanMonitoringValue(osBean, "getSystemCpuLoad") * 100));
|
||||||
"CPU Usage : " + String.format("%.2f", getBeanMonitoringValue(osBean, "getSystemCpuLoad") * 100));
|
// System.out.println("CPU Usage : " + String.format("%.2f", getBeanMonitoringValue(osBean, "getCpuLoad") * 100));
|
||||||
System.out.println(
|
// System.out.println("CPU JVM Usage : " + String.format("%.2f", getBeanMonitoringValue(osBean, "getProcessCpuLoad") * 100));
|
||||||
"CPU Usage : " + String.format("%.2f", getBeanMonitoringValue(osBean, "getCpuLoad") * 100));
|
// System.out.println("Memory Free Space G : " + String.format("%.2f",getBeanMonitoringValue(osBean, "getFreePhysicalMemorySize") / 1024 / 1024 / 1024));
|
||||||
System.out.println(
|
// System.out.println("Memory Total Space G : " + String.format("%.2f",getBeanMonitoringValue(osBean, "getTotalPhysicalMemorySize") / 1024 / 1024 / 1024));
|
||||||
"CPU JVM Usage : " + String.format("%.2f", getBeanMonitoringValue(osBean, "getProcessCpuLoad") * 100));
|
|
||||||
System.out.println("Memory Free Space G : " + String.format("%.2f",
|
|
||||||
getBeanMonitoringValue(osBean, "getFreePhysicalMemorySize") / 1024 / 1024 / 1024));
|
|
||||||
System.out.println("Memory Total Space G : " + String.format("%.2f",
|
|
||||||
getBeanMonitoringValue(osBean, "getTotalPhysicalMemorySize") / 1024 / 1024 / 1024));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getCpuPercentage() {
|
public static int getCpuPercentage() {
|
||||||
@@ -82,9 +77,9 @@ public class WindowsSystemMon {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// printSystemUsage();
|
// printSystemUsage();
|
||||||
System.out.println("getCpuPercentage = " + getCpuPercentage());
|
// System.out.println("getCpuPercentage = " + getCpuPercentage());
|
||||||
System.out.println("getMemoryPercentage = " + getMemoryPercentage());
|
// System.out.println("getMemoryPercentage = " + getMemoryPercentage());
|
||||||
System.out.println("getDiskPercentage = " + getDiskPercentage());
|
// System.out.println("getDiskPercentage = " + getDiskPercentage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user