aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-02-04 14:34:31 +0000
committerLuck <git@lucko.me>2019-02-04 14:34:31 +0000
commit77c93aeeea763c68a4fd7f5b59afcfc2f6336379 (patch)
tree7bdd7ce13eb18f785b286dc56cbace448793a7c1 /spark-common/src/main/java/me/lucko/spark/common
parent54e902ab314de8791888ef39fa51f0a7529616f7 (diff)
downloadspark-77c93aeeea763c68a4fd7f5b59afcfc2f6336379.tar.gz
spark-77c93aeeea763c68a4fd7f5b59afcfc2f6336379.tar.bz2
spark-77c93aeeea763c68a4fd7f5b59afcfc2f6336379.zip
Add combine-all thread grouping argument
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java7
1 files changed, 5 insertions, 2 deletions
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<S> implements CommandModule<S> {
.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<S> implements CommandModule<S> {
}
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<S> implements CommandModule<S> {
}
})
.tabCompleter((platform, sender, arguments) -> {
- List<String> opts = new ArrayList<>(Arrays.asList("--timeout", "--regex",
+ List<String> 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