Class ProfileViewer
- java.lang.Object
-
- org.opends.server.plugins.profiler.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 Summary
Constructors Constructor Description ProfileViewer()Creates a new profile viewer object without any data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisplayGUI()Displays a simple GUI with the profile data.ProfileStackFrame[]getRootFrames()Retrieves an array containing the root frames for the profile information.longgetTotalDuration()Retrieves the total duration in milliseconds covered by the profile data.longgetTotalIntervals()Retrieves the total number of sample intervals for which profile data is available.static voidmain(String[] args)Parses the command-line arguments and creates an instance of the profile viewer as appropriate.voidprintProfileData()Prints the profile information to standard output in a human-readable form.voidprocessDataFile(String filename)Reads and processes the information in the provided data file into this profile viewer.voidvalueChanged(TreeSelectionEvent tse)Indicates that a node in the tree has been selected or deselected and that any appropriate action should be taken.
-
-
-
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:
valueChangedin interfaceTreeSelectionListener- Parameters:
tse- The tree selection event with information about the selection or deselection that occurred.
-
-