aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common/heapdump
diff options
context:
space:
mode:
authorMD <1917406+md678685@users.noreply.github.com>2020-06-23 12:02:43 +0100
committerGitHub <noreply@github.com>2020-06-23 12:02:43 +0100
commita2af3f8f7e3693f3e445d2998938bf448d47c35f (patch)
tree91f2f058fb114e96f121b9ee31a69dacb2f4e67f /spark-common/src/main/java/me/lucko/spark/common/heapdump
parent12918d40b17a15f0432f7ad85d8db60a87e7c5b8 (diff)
downloadspark-a2af3f8f7e3693f3e445d2998938bf448d47c35f.tar.gz
spark-a2af3f8f7e3693f3e445d2998938bf448d47c35f.tar.bz2
spark-a2af3f8f7e3693f3e445d2998938bf448d47c35f.zip
Include platform info in sampler and heap summary data (#58)
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.java8
1 files changed, 5 insertions, 3 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 56958d1..f7a562c 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
@@ -21,6 +21,7 @@
package me.lucko.spark.common.heapdump;
import me.lucko.spark.common.command.sender.CommandSender;
+import me.lucko.spark.common.PlatformInfo;
import me.lucko.spark.proto.SparkProtos;
import me.lucko.spark.proto.SparkProtos.HeapData;
import me.lucko.spark.proto.SparkProtos.HeapEntry;
@@ -127,9 +128,10 @@ public final class HeapDumpSummary {
this.entries = entries;
}
- private HeapData toProto(CommandSender creator) {
+ private HeapData toProto(PlatformInfo platformInfo, CommandSender creator) {
HeapData.Builder proto = HeapData.newBuilder();
proto.setMetadata(SparkProtos.HeapMetadata.newBuilder()
+ .setPlatform(platformInfo.toData().toProto())
.setUser(creator.toData().toProto())
.build()
);
@@ -141,10 +143,10 @@ public final class HeapDumpSummary {
return proto.build();
}
- public byte[] formCompressedDataPayload(CommandSender creator) {
+ public byte[] formCompressedDataPayload(PlatformInfo platformInfo, CommandSender creator) {
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
try (OutputStream out = new GZIPOutputStream(byteOut)) {
- toProto(creator).writeTo(out);
+ toProto(platformInfo, creator).writeTo(out);
} catch (IOException e) {
throw new RuntimeException(e);
}