diff options
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/command')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/command/modules/MemoryModule.java | 4 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/MemoryModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/MemoryModule.java index a52bf8c..0033716 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/MemoryModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/MemoryModule.java @@ -54,7 +54,7 @@ import java.util.function.LongConsumer; import java.util.zip.GZIPOutputStream; public class MemoryModule implements CommandModule { - private static final MediaType JSON_TYPE = MediaType.parse("application/json; charset=utf-8"); + private static final MediaType SPARK_HEAP_MEDIA_TYPE = MediaType.parse("application/x-spark-heap"); @Override public void registerCommands(Consumer<Command> consumer) { @@ -81,7 +81,7 @@ public class MemoryModule implements CommandModule { byte[] output = heapDump.formCompressedDataPayload(sender); try { - String key = SparkPlatform.BYTEBIN_CLIENT.postContent(output, JSON_TYPE, false).key(); + String key = SparkPlatform.BYTEBIN_CLIENT.postContent(output, SPARK_HEAP_MEDIA_TYPE, false).key(); String url = SparkPlatform.VIEWER_URL + key; resp.broadcastPrefixed(TextComponent.of("Heap dump summmary output:", TextColor.GOLD)); diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java index 4b7baae..ee16830 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java @@ -48,7 +48,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; public class SamplerModule implements CommandModule { - private static final MediaType JSON_TYPE = MediaType.parse("application/json; charset=utf-8"); + private static final MediaType SPARK_SAMPLER_MEDIA_TYPE = MediaType.parse("application/x-spark-sampler"); /** The WarmRoast instance currently running, if any */ private Sampler activeSampler = null; @@ -246,7 +246,7 @@ public class SamplerModule implements CommandModule { platform.getPlugin().runAsync(() -> { byte[] output = sampler.formCompressedDataPayload(resp.sender()); try { - String key = SparkPlatform.BYTEBIN_CLIENT.postContent(output, JSON_TYPE, false).key(); + String key = SparkPlatform.BYTEBIN_CLIENT.postContent(output, SPARK_SAMPLER_MEDIA_TYPE, false).key(); String url = SparkPlatform.VIEWER_URL + key; resp.broadcastPrefixed(TextComponent.of("Sampling results:", TextColor.GOLD)); |