Accessing coach performance statistics

As you develop and test your user interface pages, you can access statistical data that helps you evaluate coaches and ensure an optimal user interface performance.

About this task

Statistics at design time
As you are building the views in your client-side or heritage human service in the designer, on-the-fly analysis is done on the coach and view configurations. Click Show static analysis Show static analysis on the toolbar to display the results in a pop-up window.

By analyzing the statistics, you can evaluate the complexity of your user interface and make the necessary adjustments to ensure an optimal performance at run time. Based on page content, the statistics can include information such as the number of views in a coach and the number of view instances that are created at run time for each item in the bound list. Where applicable, the views that have repeating elements are also listed. Hover over any entry in the list to display details about that view, which is also shown selected on the canvas.

The numbers are indicators that let you know when you venture outside of best practices, warning you of a potential performance decline. Because not all views are equal, use the numbers as a guideline. For a better estimate of the performance impact, correlate the numbers with the complexity of the views. For example, 30 Date Time Picker views can have a heavier impact on performance than 100 Decimal or Integer views.

To prevent you from mixing different technologies, a warning icon is displayed on the static analysis toolbar icon whenever you attempt using views from different toolkits in the same coach. You can click the analysis to obtain more insight about the issue.

When you build large or complex coaches and views, the design-time WYSIWYG might also slow down the performance.
  • To disable the design-time WYSIWYG, in the coach, right-click anywhere on the canvas, then click Editor Options > Disable WYSIWYG in the Designer. When WYSIWYG is turned off, the coaches on the canvas no longer respond to changes that you make to their configuration properties.
  • When you have completed the design of your coaches and want to turn the design-time WYSIWYG back on, right-click on the canvas and click Editor Options > Enable WYSIWYG in the Designer. Enabling the WYSIWYG persists between sessions.
Statistics at run time
When you run and test the coaches in your human service, you can also access statistical data that helps you evaluate the performance of each coach. The statistics are displayed as a performance report that provides data such as the number of view instances and types of views, and breaks down the total processing time by view instance and lifecycle event handler. By analyzing the data for each coach, you can identify the segments that show delays. The performance monitor indicates the component that is responding slower. For example, if an activity in a client-side human service takes two seconds, and you see that there is a three-second delay between coaches, you might want to investigate the event between the coaches that is causing performance to slow down.

To access the performance statistics, you must first enable the runtime flag that displays the coach data, as described later in this topic. Then, as the human service runs, click Show performance statistics Show Performance Statistics in the upper-right corner of the page to display the Performance section for the first coach that completed running. Click Show Performance Statistics to display the performance statistics for each coach that completes running, or click Hide Performance Statistics Hide Performance Statistics to collapse the section.

Based on the structure and succession of coaches in your human service, the performance report includes the following statistics:
Elapsed time
For the first coach that runs in a client-side human service, the section at the top shows the elapsed time of each activity and task save since the human service started running. For the subsequent coaches, the top section shows the elapsed time of the activities and task saves that ran since the previous coach completed. When the activity makes a call to the server, a task save might be combined with that call and the elapsed time for the save will likewise be combined with the elapsed time of the activity. The task save also shows how many intermediate tracking events were included in the data for the task save. For more information, see Tools for client-side human services.
Note: The top section is not available if the coaches run in a heritage human service. Instead, only the coach layout information is displayed.
Coach layout information
The coach layout information is presented hierarchically: all the view instances first, view instances by view name next, and then individual view instances.
  • The total number of view instances
  • The view instances by view name
  • The total number of view types that are created
  • The time spent in each view instance
You can highlight individual view instances or multiple view instances by selecting the view name.
Call times
The call times represent the lengths of time (in milliseconds) spent inside the event handler functions, as defined in the views.
  • The total time spent in lifecycle event handlers
  • The time spent in event handlers for each type of view
  • The time spent in each lifecycle function
Note that any JavaScript or processing code that runs asynchronously outside of the event handler functions is not included in the statistics.
Important: To update the statistics as data changes or segments of the coach are lazily loaded (in a Tab view, for example), click Refresh Refresh.
Tip: If you want to copy and paste the statistics captured in the runtime performance monitor into a spreadsheet, click Copy to Clipboard Copy to Clipboard to copy the data as text with tab-delimited values to the clipboard.

Procedure

To enable the runtime flag that displays the performance statistics

  1. In the designer, click Run to run your client-side human service or heritage human service.
  2. In the window that opens for your first coach, press F12 to start the web browser debugger or console.
  3. In the expression editor, enter the following line:
    localStorage["CoachPerformanceMonitor"] = true;
  4. Run the human service again.
  5. To disable the performance statistics flag, enter the following line in the expression editor:
    localStorage["CoachPerformanceMonitor"] = false;
    Another way to set the local storage flag is by specifying the browser preferences, as follows:
    1. In the upper-right corner of the designer, click your user name, and select Preferences.
    2. Select Show the runtime performance monitor, then click Save. Note that Show the runtime performance monitor is a browser setting that is persisted across sessions but is not saved to the user profile in Business Automation Studio.
    Tip: Regardless of which method you use to set the local storage flag, the browser setting overrides the debug setting. The debug setting is used only if the local storage flag is not defined.