From 77c93aeeea763c68a4fd7f5b59afcfc2f6336379 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 4 Feb 2019 14:34:31 +0000 Subject: Add combine-all thread grouping argument --- .../java/me/lucko/spark/common/command/modules/SamplerModule.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'spark-common/src/main/java/me/lucko/spark/common') 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 7b456ac..6ebbee1 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 @@ -57,6 +57,7 @@ public class SamplerModule implements CommandModule { .argumentUsage("timeout", "timeout seconds") .argumentUsage("thread", "thread name") .argumentUsage("regex", null) + .argumentUsage("combine-all", null) .argumentUsage("not-combined", null) .argumentUsage("interval", "interval millis") .argumentUsage("only-ticks-over", "tick length millis") @@ -96,7 +97,9 @@ public class SamplerModule implements CommandModule { } ThreadGrouper threadGrouper; - if (arguments.boolFlag("not-combined")) { + if (arguments.boolFlag("combine-all")) { + threadGrouper = ThreadGrouper.AS_ONE; + } else if (arguments.boolFlag("not-combined")) { threadGrouper = ThreadGrouper.BY_NAME; } else { threadGrouper = ThreadGrouper.BY_POOL; @@ -171,7 +174,7 @@ public class SamplerModule implements CommandModule { } }) .tabCompleter((platform, sender, arguments) -> { - List opts = new ArrayList<>(Arrays.asList("--timeout", "--regex", + List opts = new ArrayList<>(Arrays.asList("--timeout", "--regex", "--combine-all", "--not-combined", "--interval", "--only-ticks-over", "--include-line-numbers")); opts.removeAll(arguments); opts.add("--thread"); // allowed multiple times -- cgit