Package com.codahale.metrics.jvm
Class ThreadDump
- java.lang.Object
-
- com.codahale.metrics.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
All Methods Instance Methods Concrete Methods 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.
-
-
-
Constructor Detail
-
ThreadDump
public ThreadDump(ThreadMXBean threadMXBean)
-
-
Method Detail
-
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. SeeThreadMXBean.dumpAllThreads(boolean, boolean)
- Parameters:
lockedMonitors
- dump all locked monitors if truelockedSynchronizers
- dump all locked ownable synchronizers if trueout
- an output stream
-
-