From 39075341b53058f19ace303101aba68e2d7a6856 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 18 Jul 2024 23:08:50 +0100 Subject: [PATCH] Add JVM information to viewer metadata --- .../spark/common/platform/PlatformStatisticsProvider.java | 6 ++++++ spark-common/src/main/proto/spark/spark.proto | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java index b0987c9a..db6d1779 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java +++ b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java @@ -101,6 +101,12 @@ public SystemStatistics getSystemStatistics() { .setVendorVersion(System.getProperty("java.vendor.version", "unknown")) .setVmArgs(String.join(" ", runtimeBean.getInputArguments())) .build() + ) + .setJvm(SystemStatistics.Jvm.newBuilder() + .setName(System.getProperty("java.vm.name", "unknown")) + .setVendor(System.getProperty("java.vm.vendor", "unknown")) + .setVersion(System.getProperty("java.vm.version", "unknown")) + .build() ); long uptime = runtimeBean.getUptime(); diff --git a/spark-common/src/main/proto/spark/spark.proto b/spark-common/src/main/proto/spark/spark.proto index a70b3c34..53750d72 100644 --- a/spark-common/src/main/proto/spark/spark.proto +++ b/spark-common/src/main/proto/spark/spark.proto @@ -33,6 +33,7 @@ message SystemStatistics { Java java = 6; int64 uptime = 7; map net = 8; + Jvm jvm = 9; message Cpu { int32 threads = 1; @@ -80,6 +81,12 @@ message SystemStatistics { string vm_args = 4; } + message Jvm { + string name = 1; + string vendor = 2; + string version = 3; + } + message NetInterface { RollingAverageValues rx_bytes_per_second = 1; RollingAverageValues tx_bytes_per_second = 2;