Walk through major features of Microsoft Dynamics AX 2012 Trace Parser (Part 1)
Microsoft Dynamics AX 2012 Trace Parser is a performance analyzer that helps users discover and resolve performance problems in customized Microsoft Dynamics AX systems. Unlike its previous versions, Trace Parser is now a component within the Microsoft Dynamics AX 2012 release.
Trace Parser provides user interfaces to import, process and render ETW tracing events that produced by Microsoft Dynamics AX. User can then analyze tracing events to identify performance bottlenecks such as long-running X++ methods, slow SQL queries and frequently called RPCs. Features in Trace Parser help users determine the root causes of performance problems.
This blog series will walk through the major features of Trace Parser.
Install and set up Trace Parser
Trace Parser can be installed using the Microsoft Dynamics AX 2012 setup program. Note that Trace Parser requires .Net Business Connector. In order to run Trace Parser, you also
need access to a SQL Server 2008 instance (Enterprise or Developer edition) with admin permission. Using a local SQL server instance is recommended. You don’t need to
use the same SQL instance where the AX DB is installed.
The first time you start Trace Parser, you will be prompted to set up Trace Parser database. You need to let Trace Parser create a new database for you. Do not select an existing database. Fill in server name and type a database name that doesn’t exist, and then click the “Register” button:
A message box “The specified database does not exist. Would you like to create it?” is displayed. Click“Yes” to create and register a new database.
The “Select Trace” window pops up. You can click the Cancel button to dismiss the window for now. Note the status bar at bottom displays the registered database name now:
Collect and import trace
Start Microsoft Dynamics AX 2012 client and switch to Development Workspace. Open the Tracing cockpit (in the Tools menu) form:
By default, the “Bind Parameters” and “Xpp Parameters Info” events are unchecked. This is to avoid capturing confidential information which could be exposed through the parameters of X++ methods and SQL queries. Always ask your customer or IT Admin whether it's OK to collect these information. If you have cleared the legal and privacy concerns, we recommend you check the options to collect more useful information.
To collect trace:
- Click “Start trace”, specify a trace file name. Event tracing is now enabled in AX.
- “Replay” the scenario that you are investigating in AX client. Once done, click the “Stop trace” button in Tracing Cockpit. A
trace file is now created.
- You may now click the “Open trace” button to launch a new Trace Parser instance and imports the trace automatically. For the
purpose of this walk-through, click the “Close” button to finish this step.
Tips and tricks:
- We recommend choosing “small” scenarios to produce small but relevant trace files.
- We recommend “warming up” your system before collecting the trace. This will generate less noise such as metadata reads.
- If possible, collect traces on a machine that runs AOS because traces collected on such machine contain tracing events from both server and client sessions. A helpful feature in Trace Parser, “Drill into sessions” (explained later), works only if a trace contains both server and client sessions.
In Trace Parser, click the menu item “File -> Import trace” and then specify the trace file that was created in the previous step. Trace Parser now starts importing the trace, and it may take up to minutes to finish, depending on the file size.
After importing is finished, Trace Parser displays the overview of the imported trace. The overview gives users quick ideas about the “hot spots” in the trace by showing the top-most expensive X++ method calls and SQL statements across all sessions.