|
@@ -1,6 +1,7 @@
|
|
package com.jeeplus.quartz.server;
|
|
package com.jeeplus.quartz.server;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
+import com.jeeplus.quartz.utils.DateUtils;
|
|
import com.jeeplus.quartz.utils.MathUtils;
|
|
import com.jeeplus.quartz.utils.MathUtils;
|
|
import com.jeeplus.quartz.utils.IpUtils;
|
|
import com.jeeplus.quartz.utils.IpUtils;
|
|
import oshi.SystemInfo;
|
|
import oshi.SystemInfo;
|
|
@@ -12,6 +13,7 @@ import oshi.software.os.OSFileStore;
|
|
import oshi.software.os.OperatingSystem;
|
|
import oshi.software.os.OperatingSystem;
|
|
import oshi.util.Util;
|
|
import oshi.util.Util;
|
|
|
|
|
|
|
|
+import java.lang.management.ManagementFactory;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -134,6 +136,14 @@ public class ServerOS {
|
|
jvm.put("maxTotal",div(Runtime.getRuntime().maxMemory(),1024*1024,2));
|
|
jvm.put("maxTotal",div(Runtime.getRuntime().maxMemory(),1024*1024,2));
|
|
jvm.put("usedMem", div((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()),1024*1024,2));
|
|
jvm.put("usedMem", div((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()),1024*1024,2));
|
|
jvm.put("used", MathUtils.round(MathUtils.mul((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())*1.0/ Runtime.getRuntime().totalMemory(), 100), 2));
|
|
jvm.put("used", MathUtils.round(MathUtils.mul((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())*1.0/ Runtime.getRuntime().totalMemory(), 100), 2));
|
|
|
|
+
|
|
|
|
+ //JDK启动时间
|
|
|
|
+ jvm.put("startTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()));
|
|
|
|
+ //JDK运行时间
|
|
|
|
+ jvm.put("runTime", DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()));
|
|
|
|
+ //运行参数
|
|
|
|
+ jvm.put("inputArg", ManagementFactory.getRuntimeMXBean().getInputArguments().toString());
|
|
|
|
+
|
|
return jvm;
|
|
return jvm;
|
|
}
|
|
}
|
|
|
|
|