Class ThreadDeadlockDetector

java.lang.Object
io.dropwizard.metrics5.jvm.ThreadDeadlockDetector

public class ThreadDeadlockDetector extends Object
A utility class for detecting deadlocked threads.
  • Constructor Details

    • ThreadDeadlockDetector

      public ThreadDeadlockDetector()
      Creates a new detector.
    • ThreadDeadlockDetector

      public ThreadDeadlockDetector(ThreadMXBean threads)
      Creates a new detector using the given ThreadMXBean.
      Parameters:
      threads - a ThreadMXBean
  • Method Details

    • getDeadlockedThreads

      public Set<String> getDeadlockedThreads()
      Returns a set of diagnostic stack traces for any deadlocked threads. If no threads are deadlocked, returns an empty set.
      Returns:
      stack traces for deadlocked threads or an empty set