Specifying a Root Method

See Also

When analyzing application performance, you can choose to limit the source code that is instrumented by specifying a root method. When you profile an application by instrumenting a root method, profiling data is collected when one of the application's threads enters and leaves the root method.

When you specify a root method, the method is added to the list of selected root methods which you can choose to instrument when profiling application performance. The selected root methods are listed in the Specify Root Methods dialog box. Each profile application performance configuration is associated with a specific set of selected root methods.

You can specify root methods in the source code of a class or in the Select Profiling Task dialog box when setting options for analyzing application performance.

To specify a single root method in a class:

  1. Locate the class containing the method you want to add and open the class in the Source Editor.
  2. In the Source Editor, right-click in the method you want to add and choose Profiling > Add as Profiling Root Method.
  3. Select a profiling configuration and click OK.

When you click OK, the method is added to the root methods that are associated with that profiling configuration.

To specify multiple root methods in a class:

  1. Locate the class containing the method you want to add and open the class in the Source Editor.
  2. In the Source Editor, right-click in the source code and choose Profiling > Select Profiling Root Methods.
  3. Select a profiling configuration and click OK to open the Select Root Methods dialog box.
  4. Expand the package and method nodes, select the methods you want to add as root methods and click OK.

When you click OK, the selected methods are added to the root methods that are associated with that profiling configuration.

Note: If you right-click in an object that is part of another class, the Select Root Methods dialog box will allow you to select root methods in that class.

Notes:

To specify root methods when setting options for analyzing application performance:

  1. Open the Select Profiling Task dialog box and select the analyze CPU task.
  2. Select Profile Application.
  3. Click customize (if no methods are defined) to open the Specify Root Methods dialog box.

    If some methods are already defined, click edit.

  4. Expand the tree and select the nodes for the root methods to instrument.

    You can use the Select View dropdown list to modify the project tree view.

  5. (Optional) Click Advanced to further edit the list of of root methods.
  6. Click OK.

When you click OK the root method is added to the list of root methods that will be instrumented. You can modify the list at any time by clicking customize or edit in the Select Profiling Task dialog box.

For more, see the following NetBeans FAQ:

See Also
Analyzing Application Performance

Legal Notices