org.opends.server.plugins.profiler
Class ProfileViewer

java.lang.Object
  extended by org.opends.server.plugins.profiler.ProfileViewer
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.TreeSelectionListener

public class ProfileViewer
extends java.lang.Object
implements javax.swing.event.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
ProfileViewer()
          Creates a new profile viewer object without any data.
 
Method Summary
 void displayGUI()
          Displays a simple GUI with the profile data.
 ProfileStackFrame[] getRootFrames()
          Retrieves an array containing the root frames for the profile information.
 long getTotalDuration()
          Retrieves the total duration in milliseconds covered by the profile data.
 long getTotalIntervals()
          Retrieves the total number of sample intervals for which profile data is available.
static void main(java.lang.String[] args)
          Parses the command-line arguments and creates an instance of the profile viewer as appropriate.
 void printProfileData()
          Prints the profile information to standard output in a human-readable form.
 void processDataFile(java.lang.String filename)
          Reads and processes the information in the provided data file into this profile viewer.
 void valueChanged(javax.swing.event.TreeSelectionEvent tse)
          Indicates that a node in the tree has been selected or deselected and that any appropriate action should be taken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(java.lang.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(java.lang.String filename)
                     throws java.io.IOException,
                            ASN1Exception
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:
java.io.IOException - If a problem occurs while trying to read from the data file.
ASN1Exception - If an error occurs while trying to decode the contents of the file into profile stack objects.

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(javax.swing.event.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 javax.swing.event.TreeSelectionListener
Parameters:
tse - The tree selection event with information about the selection or deselection that occurred.