aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java6
-rw-r--r--spark-common/src/main/proto/spark/spark.proto1
2 files changed, 6 insertions, 1 deletions
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 a9d83b2..a16c643 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
@@ -32,6 +32,7 @@ import me.lucko.spark.proto.SparkProtos.SystemStatistics;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryUsage;
+import java.lang.management.RuntimeMXBean;
import java.util.Map;
public class PlatformStatisticsProvider {
@@ -42,6 +43,8 @@ public class PlatformStatisticsProvider {
}
public SystemStatistics getSystemStatistics() {
+ RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
+
SystemStatistics.Builder builder = SystemStatistics.newBuilder()
.setCpu(SystemStatistics.Cpu.newBuilder()
.setThreads(Runtime.getRuntime().availableProcessors())
@@ -85,10 +88,11 @@ public class PlatformStatisticsProvider {
.setVendor(System.getProperty("java.vendor", "unknown"))
.setVersion(System.getProperty("java.version", "unknown"))
.setVendorVersion(System.getProperty("java.vendor.version", "unknown"))
+ .setVmArgs(String.join(" ", runtimeBean.getInputArguments()))
.build()
);
- long uptime = ManagementFactory.getRuntimeMXBean().getUptime();
+ long uptime = runtimeBean.getUptime();
builder.setUptime(uptime);
Map<String, GarbageCollectorStatistics> gcStats = GarbageCollectorStatistics.pollStats();
diff --git a/spark-common/src/main/proto/spark/spark.proto b/spark-common/src/main/proto/spark/spark.proto
index b4f9efb..678df3a 100644
--- a/spark-common/src/main/proto/spark/spark.proto
+++ b/spark-common/src/main/proto/spark/spark.proto
@@ -74,6 +74,7 @@ message SystemStatistics {
string vendor = 1;
string version = 2;
string vendor_version = 3;
+ string vm_args = 4;
}
}