Class 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.
    • Constructor Detail

      • ProfilerThread

        public ProfilerThread​(long sampleInterval)
        Creates a new profiler thread that will obtain stack traces at the specified interval.
        Parameters:
        sampleInterval - The length of time in milliseconds between polls for stack trace information.
    • Method Detail

      • run

        public void run()
        Runs in a loop, periodically capturing a list of the stack traces for all active threads.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • 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.