From 946d966fed49899fa78a0ec55b3d3f4d7009f5b4 Mon Sep 17 00:00:00 2001 From: Max Lee Date: Wed, 9 Mar 2022 10:06:58 +0100 Subject: [PATCH] Add CPU name and JVM vendor info in timings (#7490) --- patches/server/Timings-v2.patch | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/patches/server/Timings-v2.patch b/patches/server/Timings-v2.patch index bfe95f09a8..c1ea80053c 100644 --- a/patches/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -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()))))