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 Part of Application.
  3. Click define (if no methods are defined) or edit (if some methods are already defined) to open the Specify Root Methods dialog.
  4. Click one of the following options.
  5. Click OK.

When you click OK the root method is added to the list of root methods displayed in the Specify Root Method dialog box. You can select a method from the list and click Remove to delete the method from the list.

For more, see the following NetBeans FAQ:

See Also
Analyzing Application Performance

Legal Notices