diff options
author | MD <1917406+md678685@users.noreply.github.com> | 2020-06-23 12:02:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 12:02:43 +0100 |
commit | a2af3f8f7e3693f3e445d2998938bf448d47c35f (patch) | |
tree | 91f2f058fb114e96f121b9ee31a69dacb2f4e67f /spark-common/src/main/java/me/lucko/spark/common/sampler | |
parent | 12918d40b17a15f0432f7ad85d8db60a87e7c5b8 (diff) | |
download | spark-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/sampler')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/sampler/Sampler.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/Sampler.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/Sampler.java index 63383b4..cc72ca7 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/Sampler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/Sampler.java @@ -23,6 +23,7 @@ package me.lucko.spark.common.sampler; import com.google.common.util.concurrent.ThreadFactoryBuilder; import me.lucko.spark.common.command.sender.CommandSender; +import me.lucko.spark.common.PlatformInfo; import me.lucko.spark.common.sampler.aggregator.DataAggregator; import me.lucko.spark.common.sampler.aggregator.SimpleDataAggregator; import me.lucko.spark.common.sampler.aggregator.TickedDataAggregator; @@ -161,8 +162,9 @@ public class Sampler implements Runnable { } } - private SamplerData toProto(CommandSender creator, Comparator<? super Map.Entry<String, ThreadNode>> outputOrder, String comment, MergeMode mergeMode) { + private SamplerData toProto(PlatformInfo platformInfo, CommandSender creator, Comparator<? super Map.Entry<String, ThreadNode>> outputOrder, String comment, MergeMode mergeMode) { final SamplerMetadata.Builder metadata = SamplerMetadata.newBuilder() + .setPlatform(platformInfo.toData().toProto()) .setUser(creator.toData().toProto()) .setStartTime(this.startTime) .setInterval(this.interval) @@ -186,8 +188,8 @@ public class Sampler implements Runnable { return proto.build(); } - public byte[] formCompressedDataPayload(CommandSender creator, Comparator<? super Map.Entry<String, ThreadNode>> outputOrder, String comment, MergeMode mergeMode) { - SamplerData proto = toProto(creator, outputOrder, comment, mergeMode); + public byte[] formCompressedDataPayload(PlatformInfo platformInfo, CommandSender creator, Comparator<? super Map.Entry<String, ThreadNode>> outputOrder, String comment, MergeMode mergeMode) { + SamplerData proto = toProto(platformInfo, creator, outputOrder, comment, mergeMode); ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); try (OutputStream out = new GZIPOutputStream(byteOut)) { |