aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2018-12-31 19:50:37 +0000
committerLuck <git@lucko.me>2018-12-31 19:50:37 +0000
commit4bad610d9bca2aa1eed0e6c9ee231efe2e9f2798 (patch)
tree4bacfd0ecb26cff8e7613ab10276a5a9d7c258b6 /spark-common/src/main/java/me/lucko/spark/common
parent3be95dbe1305b176fc8c25d636454c159390fae7 (diff)
downloadspark-4bad610d9bca2aa1eed0e6c9ee231efe2e9f2798.tar.gz
spark-4bad610d9bca2aa1eed0e6c9ee231efe2e9f2798.tar.bz2
spark-4bad610d9bca2aa1eed0e6c9ee231efe2e9f2798.zip
Allow thread names to be specified using regex
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.java8
1 files changed, 7 insertions, 1 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 5fd8b5b..fe719eb 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
@@ -56,6 +56,7 @@ public class SamplerModule<S> implements CommandModule<S> {
.aliases("start")
.argumentUsage("timeout", "timeout seconds")
.argumentUsage("thread", "thread name")
+ .argumentUsage("regex", null)
.argumentUsage("not-combined", null)
.argumentUsage("interval", "interval millis")
.argumentUsage("only-ticks-over", "tick length millis")
@@ -86,7 +87,12 @@ public class SamplerModule<S> implements CommandModule<S> {
} else if (threads.contains("*")) {
threadDumper = ThreadDumper.ALL;
} else {
- threadDumper = new ThreadDumper.Specific(threads);
+ if (arguments.boolFlag("regex")) {
+ threadDumper = new ThreadDumper.Regex(threads);
+ } else {
+ // specific matches
+ threadDumper = new ThreadDumper.Specific(threads);
+ }
}
ThreadGrouper threadGrouper;