Class ProfilerThread
- java.lang.Object
-
- java.lang.Thread
-
- org.opends.server.api.DirectoryThread
-
- org.opends.server.plugins.profiler.ProfilerThread
-
- All Implemented Interfaces:
Runnable
public class ProfilerThread extends DirectoryThread
This class defines a thread that may be used to actually perform profiling in the Directory Server. When activated, it will repeatedly retrieve thread stack traces and store them so that they can be written out and analyzed with a separate utility.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.server.api.DirectoryThread
DirectoryThread.Factory
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class org.opends.server.api.DirectoryThread
DIRECTORY_THREAD_GROUP
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ProfilerThread(long sampleInterval)Creates a new profiler thread that will obtain stack traces at the specified interval.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Runs in a loop, periodically capturing a list of the stack traces for all active threads.voidstopProfiling()Causes the profiler thread to stop capturing stack traces.voidwriteCaptureData(String filename)Writes the information captured by this profiler thread to the specified file.-
Methods inherited from class org.opends.server.api.DirectoryThread
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, initiateShutdown, isShutdownInitiated, setAssociatedTask, startWork, stopWork
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
run
public void run()
Runs in a loop, periodically capturing a list of the stack traces for all active threads.
-
stopProfiling
public void stopProfiling()
Causes the profiler thread to stop capturing stack traces. This method will not return until the thread has stopped.
-
writeCaptureData
public void writeCaptureData(String filename) throws IOException
Writes the information captured by this profiler thread to the specified file. This should only be called after- Parameters:
filename- The path and name of the file to write.- Throws:
IOException- If a problem occurs while trying to write the capture data.
-
-