Sun Identity Manager 8.1 Release Notes

ProcedureStep 4: Set the Profiler Options

For the purposes of this tutorial, specify the following Profiler options:

  1. On the Mode tab, select Java and IDM Objects to profile form, Java, rule, workflow, and XPRESS objects.

  2. Select the Java Filters tab.

    Use the following steps to disable all Identity Manager Java classes except your custom Java classes (in this case, org.example.ProfilerTutorialExample):

    1. Click New and a new, blank field appears at the bottom of the Filter column.

    2. Enter com.waveset.* into the new field, and then select the Exclude box.

    3. Click New again.

    4. Enter com.sun.idm.* into the new field, and then select the Exclude box.

  3. Click OK to run the Profiler.


    Note –

    The Profiler takes a few minutes to complete the first time you run it on a project or if you have recently performed a Clean Project action.


    When the Profiler finishes processing, you are prompted to Log In.

  4. Enter the password configurator, select the Remember Password box, and then click OK to continue.

  5. When the Identity Manager window displays, log in.


    Note –

    Typically, you should log in to Identity Manager as a different user instead of logging in as configurator again. You are already logged into the Profiler as configurator, and the Identity Manager session pool only allows one entry per user. Using multiple entries can result in the appearance of a broken session pool and might skew your profiling results for finer-grained performance problems.

    However, for this simple example the session pool is of no consequence so you can login as configurator/configurator.


  6. In Identity Manager, select Server Tasks -> Run Tasks, and then click ProfilerTutorialWorkflow1.

    The tutorial might take a few moments to respond.

  7. Although you could take a snapshot now; you are going to reset your results instead, run the Profiler, run it again, and then take a snapshot.


    Note –

    It is a best practice to run the Profiler a couple of times before taking a snapshot to be sure all the caches are primed, all the JSPs are compiled, and so forth.

    Running the Profiler several times enables you to focus on actual performance problems. The only exception to this practice is if you are having a problem populating the caches themselves.


    1. Return to the IDM Profiler view in the Identity Manager IDE. Click the Reset Collected Results icon in the Profiling Results section (or in the Controls section) to reset all of the results collected so far.

    2. In Identity Manager, select Server Tasks -> Run Tasks again, and click ProfilerTutorialWorkflow1.

    3. When the Process Diagram displays, return to the Identity Manager IDE and click Take Snapshot in the Profiling Results section.

  8. The Identity Manager IDE downloads your snapshot and displays the results on the right side of the window.

    This area is the Call Tree view. At the top of the Call Tree, you should see a /idm/task/taskLaunch.jsp with a time listed in the Time column. The time should indicate that the entire request took six+ seconds.

  9. Expand the /idm/task/taskLaunch.jsp node, and you can see that ProfilerTutorialWorkflow1 took six seconds.

  10. Expand the ProfilerTutorialWorkflow1 node. Note that activity2 took four seconds and activity1 took two seconds.

  11. Expand activity2.

    Note that action1 took two seconds and action2 took two seconds.

  12. Expand action1 and note that the <invoke> also took two seconds.

  13. Double-click the <invoke> to open ProfilerTutorialWorkflow1.xml and highlight the following line:


    <invoke name=’example’ class=’org.example.ProfilerTutorialExample’/>

    You should see that a call to the ProfilerTutorialExample method took two seconds.


    Note –

    You are actually browsing XML source that was captured in the snapshot, rather than source in the project. Snapshots are completely self-contained. (For more information, see How the Profiler Locates and Manages Source.)


  14. Select the CPU:<date><time> tab to return to your snapshot.

  15. Expand the <invoke> node, and note that the Profiler spent two seconds in the Java ProfilerTutorialExample.example() method.

  16. Double-click the method name to open the ProfilerTutorialExample.java source and highlight the following line:


    Thread.sleep(2000);

    There’s the problem! This method contains a two-second thread sleep.

  17. If you return to the Call Tree, you can see that all of the two second paths lead to this method. (You should see three paths; for a total of six seconds.)

  18. Select the Hotspots tab (located at the bottom of the Call Tree area) to open the Hotspots view. Notice that ProfilerTutorialExample.example() has a total self time of six seconds.

    (For more information about Hotspots, see Working with the Snapshot View.)

  19. Right-click ProfilerTutorialExample.example() and select Show Back Traces from the pop-up menu.

    A new Back Traces tab displays at the bottom of the area.

  20. Expand the ProfilerTutorialExample.example() node on the Back Traces tab to see that this method was called from three places, and that the method took two seconds when it was called from each place.

    (For more information about Back Traces, see Working with the Snapshot View.)

  21. Click the Save the snapshot in the project icon to save your snapshot and close it.

    If you check the Saved Snapshots section on the IDM Profiler tab, you should see your snapshot. (You might have to scroll down.)

  22. Select the saved snapshot, and then click Open to re-open it.


    Note –

    You can use the Save As button to save your snapshots externally and use the Load button to load a snapshot from outside your project.


  23. Close the snapshot again.