Skip Headers
Previous
Previous
 
Next
Next

Working with Templates

Templates are a user-defined collection of methods you want profiled during run time. By using templates, you can easily profile the same methods during each profiling round. This not only saves time, but it ensures consistency and accuracy of the profile results. This section shows how to use the Method Profiler tab by setting up your own templates.

To create a template:

  1. In the Templates panel, click Add.

    The Add Template dialog box appears.

  2. Enter a name for your template (for example, Methods to Profile) and click OK.

    The new template appears in the Templates list (Figure: New Template Added).

New Template Added

Description of this figure follows
Description of " New Template Added"

To rename a template:

  1. Select the template that you want to rename.

  2. Click Edit.

    The Edit template dialog box appears.

  3. Enter a new name for the template.

  4. Click OK.

    The renamed template appears on the Templates list.

To delete a template:

  1. In the Templates panel, select the template you want to delete.

  2. Click Delete.

To add methods to the template:

  1. In the Templates panel, select the template to which you want to add methods.

    The title of the template list changes to match the name of the selected template.

  2. In the Method List panel, click Add.

    The Add Class dialog box appears.

  3. Enter the name of the class you want to profile (for example, java.lang.Integer) and click OK.

    The new class appears in the list of methods for the selected template (Figure: Method List with Class Added).

    Method List with Class Added

    Description of this figure follows
    Description of " Method List with Class Added"

  4. Click the plus sign (+) next to the class name to see the methods that are included in that class.

    The list expands to show all methods in that class. The methods are indicated by an M icon (Figure: M Graphics Indicate Methods).

    M Graphics Indicate Methods

    Description of this figure follows
    Description of " M Graphics Indicate Methods"

  5. Select each method you want to profile.

    The selected methods will be profiled when method profiling is started, as described in "Profiling Methods".

To delete a method from the template:

  1. In the list of methods, select the method you want to delete.

  2. Click Delete.