Class ThreadDump

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

public class ThreadDump
extends Object
A convenience class for getting a thread dump.
  • Constructor Summary

    Constructors
    Constructor Description
    ThreadDump​(ThreadMXBean threadMXBean)  
  • Method Summary

    Modifier and Type Method Description
    void dump​(boolean lockedMonitors, boolean lockedSynchronizers, OutputStream out)
    Dumps all of the threads' current information, optionally including synchronization, to an output stream.
    void dump​(OutputStream out)
    Dumps all of the threads' current information, including synchronization, to an output stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ThreadDump

      public ThreadDump​(ThreadMXBean threadMXBean)
  • Method Details

    • dump

      public void dump​(OutputStream out)
      Dumps all of the threads' current information, including synchronization, to an output stream.
      Parameters:
      out - an output stream
    • dump

      public void dump​(boolean lockedMonitors, boolean lockedSynchronizers, OutputStream out)
      Dumps all of the threads' current information, optionally including synchronization, to an output stream. Having control over including synchronization info allows using this method (and its wrappers, i.e. ThreadDumpServlet) in environments where getting object monitor and/or ownable synchronizer usage is not supported. It can also speed things up. See ThreadMXBean.dumpAllThreads(boolean, boolean)
      Parameters:
      lockedMonitors - dump all locked monitors if true
      lockedSynchronizers - dump all locked ownable synchronizers if true
      out - an output stream