Class ThreadDumps
java.lang.Object
com.cloudbees.jenkins.support.api.Component
com.cloudbees.jenkins.support.api.ObjectComponent<Computer>
com.cloudbees.jenkins.support.impl.ThreadDumps
- All Implemented Interfaces:
ExtensionPoint,Describable<ObjectComponent<Computer>>
Thread dumps from the nodes.
- Author:
- Stephen Connolly
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.cloudbees.jenkins.support.api.Component
Component.ComponentCategoryNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContents(Container result) Add contents to a containervoidaddContents(Container container, Computer item) Add contents from a specific item to a containerstatic voidcollectMultiple(FileListCap fileList, long timestamp, long delay, int iterations) Collects multiple thread dumps and saves them to the specified file list.static voidcollectMultiple(FileListCap fileList, long timestamp, long delay, int iterations, Level loggingLevel) Collects multiple thread dumps and saves them to the specified file list.Specify in whichComponent.ComponentCategorythe current component is related.Returns the (possibly empty, never null) list of permissions that are required for the user to include this in a bundle.hudson.remoting.Future<String>getThreadDump(Node node) static StringgetThreadDump(hudson.remoting.VirtualChannel channel) Deprecated.booleanisApplicable(Computer item) Return if this component is applicable to a specific item.<C extends AbstractModelObject>
booleanisApplicable(Class<C> clazz) Return if this component is applicable to a specific class of item.static voidprintThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean) static voidprintThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean, ContentFilter filter) Prints theThreadInfo(becauseThreadInfo.toString()caps out the stack trace at 8 frames).static voidthreadDump(OutputStream out) Dumps all of the threads' current information to an output stream.static voidDeprecated.static voidDeprecated.Methods inherited from class com.cloudbees.jenkins.support.api.ObjectComponent
allInstances, for_, isSelectedByDefaultMethods inherited from class com.cloudbees.jenkins.support.api.Component
canBeGeneratedAsync, getDisplayPermissions, getId, isEnabled, isSelectedByDefault, start, supersedes
-
Constructor Details
-
ThreadDumps
@DataBoundConstructor public ThreadDumps()
-
-
Method Details
-
collectMultiple
public static void collectMultiple(FileListCap fileList, long timestamp, long delay, int iterations) Collects multiple thread dumps and saves them to the specified file list.- Parameters:
fileList- the file list where the thread dumps will be savedtimestamp- the initial timestampdelay- the delay between two consecutive thread dumpsiterations- the number of thread dumps to collect
-
collectMultiple
public static void collectMultiple(FileListCap fileList, long timestamp, long delay, int iterations, Level loggingLevel) Collects multiple thread dumps and saves them to the specified file list.- Parameters:
fileList- the file list where the thread dumps will be savedtimestamp- the initial timestampdelay- the delay between two consecutive thread dumpsiterations- the number of thread dumps to collectloggingLevel- the logging level to use for logging errors
-
getRequiredPermissions
Description copied from class:ComponentReturns the (possibly empty, never null) list of permissions that are required for the user to include this in a bundle. An empty list indicates that any user can include this bundle.- Specified by:
getRequiredPermissionsin classComponent- Returns:
- the (possibly empty, never null) list of permissions that are required for the user to include this in a bundle.
-
getDisplayName
- Specified by:
getDisplayNamein classComponent
-
isApplicable
Description copied from class:ObjectComponentReturn if this component is applicable to a specific class of item.- Overrides:
isApplicablein classObjectComponent<Computer>- Type Parameters:
C- Object that extendsAbstractModelObject- Parameters:
clazz- the class- Returns:
trueif applicable to this class
-
isApplicable
Description copied from class:ObjectComponentReturn if this component is applicable to a specific item.- Overrides:
isApplicablein classObjectComponent<Computer>- Parameters:
item- the item- Returns:
- true if applicable
-
addContents
Description copied from class:ObjectComponentAdd contents to a container- Overrides:
addContentsin classObjectComponent<Computer>- Parameters:
result- aContainer
-
addContents
Description copied from class:ObjectComponentAdd contents from a specific item to a container- Specified by:
addContentsin classObjectComponent<Computer>- Parameters:
container- theContaineritem- the item
-
getCategory
Description copied from class:ComponentSpecify in whichComponent.ComponentCategorythe current component is related.- Overrides:
getCategoryin classComponent- Returns:
- An enum value of
Component.ComponentCategory.
-
getThreadDump
- Throws:
IOException
-
getThreadDump
@Deprecated public static String getThreadDump(hudson.remoting.VirtualChannel channel) throws IOException, InterruptedException Deprecated.- Throws:
IOExceptionInterruptedException
-
threadDump
Dumps all of the threads' current information to an output stream.- Parameters:
out- an output stream.- Throws:
UnsupportedEncodingException- if the utf-8 encoding is not supported.
-
printThreadInfo
-
printThreadInfo
public static void printThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean, @NonNull ContentFilter filter) Prints theThreadInfo(becauseThreadInfo.toString()caps out the stack trace at 8 frames). It filters the content with the filter. It's used by other components, likeDeadlockRequestComponentviaDeadlockTrackChecker- Parameters:
writer- the writer to print to.t- the thread to printmbean- theThreadMXBeanto use.filter- theContentFilterto use for filtering the thread name.
-
threadDumpModern
@Deprecated public static void threadDumpModern(OutputStream out) throws UnsupportedEncodingException Deprecated.- Throws:
UnsupportedEncodingException
-
threadDumpLegacy
@Deprecated public static void threadDumpLegacy(OutputStream out) throws UnsupportedEncodingException Deprecated.- Throws:
UnsupportedEncodingException
-
getDescriptor
Description copied from class:ObjectComponent- Specified by:
getDescriptorin interfaceDescribable<ObjectComponent<Computer>>- Overrides:
getDescriptorin classObjectComponent<Computer>
-
threadDump(java.io.OutputStream)