diff options
author | Luck <git@lucko.me> | 2018-12-31 19:50:37 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2018-12-31 19:50:37 +0000 |
commit | 4bad610d9bca2aa1eed0e6c9ee231efe2e9f2798 (patch) | |
tree | 4bacfd0ecb26cff8e7613ab10276a5a9d7c258b6 /spark-common/src/main/java/me/lucko/spark/common | |
parent | 3be95dbe1305b176fc8c25d636454c159390fae7 (diff) | |
download | spark-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.java | 8 |
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; |