aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/me/lucko/spark/profiler
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/me/lucko/spark/profiler')
-rw-r--r--common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java b/common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java
index 17047fd..9c2e974 100644
--- a/common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java
+++ b/common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java
@@ -20,6 +20,8 @@ package me.lucko.spark.profiler;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
+import java.util.Set;
+import java.util.stream.Collectors;
/**
* Uses the {@link ThreadMXBean} to generate {@link ThreadInfo} instances for the threads being
@@ -56,9 +58,10 @@ public interface ThreadDumper {
this.ids = ids;
}
- public Specific(String name) {
+ public Specific(Set<String> names) {
+ Set<String> threadNamesLower = names.stream().map(String::toLowerCase).collect(Collectors.toSet());
this.ids = Thread.getAllStackTraces().keySet().stream()
- .filter(t -> t.getName().equalsIgnoreCase(name))
+ .filter(t -> threadNamesLower.contains(t.getName().toLowerCase()))
.mapToLong(Thread::getId)
.toArray();
}