mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add CPU name and JVM vendor info in timings (#7490)
This commit is contained in:
parent
a99947054f
commit
946d966fed
1 changed files with 7 additions and 0 deletions
|
@ -204,6 +204,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import org.bukkit.entity.EntityType;
|
||||
+import org.json.simple.JSONObject;
|
||||
+import org.json.simple.JSONValue;
|
||||
+import oshi.SystemInfo;
|
||||
+import oshi.hardware.HardwareAbstractionLayer;
|
||||
+
|
||||
+import java.io.ByteArrayOutputStream;
|
||||
+import java.io.IOException;
|
||||
|
@ -295,12 +297,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ OperatingSystemMXBean osInfo = ManagementFactory.getOperatingSystemMXBean();
|
||||
+
|
||||
+ HardwareAbstractionLayer hardwareInfo = new SystemInfo().getHardware();
|
||||
+
|
||||
+ parent.put("system", createObject(
|
||||
+ pair("timingcost", getCost()),
|
||||
+ pair("loadavg", osInfo.getSystemLoadAverage()),
|
||||
+ pair("name", System.getProperty("os.name")),
|
||||
+ pair("version", System.getProperty("os.version")),
|
||||
+ pair("jvmversion", System.getProperty("java.version")),
|
||||
+ pair("jvmvendor", System.getProperty("java.vendor")),
|
||||
+ pair("jvmvendorversion", System.getProperty("java.vendor.version")),
|
||||
+ pair("arch", System.getProperty("os.arch")),
|
||||
+ pair("maxmem", runtime.maxMemory()),
|
||||
+ pair("memory", createObject(
|
||||
|
@ -309,6 +315,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ pair("finalizing", ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount())
|
||||
+ )),
|
||||
+ pair("cpu", runtime.availableProcessors()),
|
||||
+ pair("cpuname", hardwareInfo.getProcessor().getProcessorIdentifier().getName().trim()),
|
||||
+ pair("runtime", runtimeBean.getUptime()),
|
||||
+ pair("flags", StringUtils.join(runtimeBean.getInputArguments(), " ")),
|
||||
+ pair("gc", toObjectMapper(ManagementFactory.getGarbageCollectorMXBeans(), input -> pair(input.getName(), toArray(input.getCollectionCount(), input.getCollectionTime()))))
|
||||
|
|
Loading…
Reference in a new issue