Class ProfileViewer

  • All Implemented Interfaces:
    EventListener, TreeSelectionListener

    public class ProfileViewer
    extends Object
    implements TreeSelectionListener
    This class defines a Directory Server utility that may be used to view profile information that has been captured by the profiler plugin. It supports viewing this information in either a command-line mode or using a simple GUI.
    • Constructor Detail

      • ProfileViewer

        public ProfileViewer()
        Creates a new profile viewer object without any data. It should be populated with one or more calls to processDataFile
    • Method Detail

      • main

        public static void main​(String[] args)
        Parses the command-line arguments and creates an instance of the profile viewer as appropriate.
        Parameters:
        args - The command-line arguments provided to this program.
      • processDataFile

        public void processDataFile​(String filename)
                             throws IOException
        Reads and processes the information in the provided data file into this profile viewer.
        Parameters:
        filename - The path to the file containing the data to be read.
        Throws:
        IOException - If a problem occurs while trying to read from the data file.
      • getRootFrames

        public ProfileStackFrame[] getRootFrames()
        Retrieves an array containing the root frames for the profile information. The array will be sorted in descending order of matching stacks. The elements of this array will be the leaf method names with sub-frames holding information about the callers of those methods.
        Returns:
        An array containing the root frames for the profile information.
      • getTotalIntervals

        public long getTotalIntervals()
        Retrieves the total number of sample intervals for which profile data is available.
        Returns:
        The total number of sample intervals for which profile data is available.
      • getTotalDuration

        public long getTotalDuration()
        Retrieves the total duration in milliseconds covered by the profile data.
        Returns:
        The total duration in milliseconds covered by the profile data.
      • printProfileData

        public void printProfileData()
        Prints the profile information to standard output in a human-readable form.
      • displayGUI

        public void displayGUI()
        Displays a simple GUI with the profile data.
      • valueChanged

        public void valueChanged​(TreeSelectionEvent tse)
        Indicates that a node in the tree has been selected or deselected and that any appropriate action should be taken.
        Specified by:
        valueChanged in interface TreeSelectionListener
        Parameters:
        tse - The tree selection event with information about the selection or deselection that occurred.