aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common/heapdump
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-12-28 18:12:33 +0000
committerLuck <git@lucko.me>2021-12-28 18:12:33 +0000
commitbfbbcb3e68e019da4657ef0da22b889de656ae3f (patch)
treeb49b109cd6415bf74f34e0cb0fd1dbbd83534a67 /spark-common/src/main/java/me/lucko/spark/common/heapdump
parent97320645783f21893a4a8dc3af0a29804f1cf6dd (diff)
downloadspark-bfbbcb3e68e019da4657ef0da22b889de656ae3f.tar.gz
spark-bfbbcb3e68e019da4657ef0da22b889de656ae3f.tar.bz2
spark-bfbbcb3e68e019da4657ef0da22b889de656ae3f.zip
Include platform and system statistics in profiler viewer payload
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/heapdump')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java
index 34fd6c4..7bb411d 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java
@@ -20,11 +20,11 @@
package me.lucko.spark.common.heapdump;
+import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.command.sender.CommandSender;
-import me.lucko.spark.common.platform.PlatformInfo;
-import me.lucko.spark.proto.SparkProtos;
-import me.lucko.spark.proto.SparkProtos.HeapData;
-import me.lucko.spark.proto.SparkProtos.HeapEntry;
+import me.lucko.spark.proto.SparkHeapProtos.HeapData;
+import me.lucko.spark.proto.SparkHeapProtos.HeapEntry;
+import me.lucko.spark.proto.SparkHeapProtos.HeapMetadata;
import org.objectweb.asm.Type;
@@ -125,10 +125,12 @@ public final class HeapDumpSummary {
this.entries = entries;
}
- public HeapData toProto(PlatformInfo platformInfo, CommandSender creator) {
+ public HeapData toProto(SparkPlatform platform, CommandSender creator) {
HeapData.Builder proto = HeapData.newBuilder();
- proto.setMetadata(SparkProtos.HeapMetadata.newBuilder()
- .setPlatformMetadata(platformInfo.toData().toProto())
+ proto.setMetadata(HeapMetadata.newBuilder()
+ .setPlatformMetadata(platform.getPlugin().getPlatformInfo().toData().toProto())
+ .setPlatformStatistics(platform.getStatisticsProvider().getPlatformStatistics(null))
+ .setSystemStatistics(platform.getStatisticsProvider().getSystemStatistics())
.setCreator(creator.toData().toProto())
.build()
);