Learn to use Visual Studio, Visual Studio Online, Application Insights and Team Foundation Server to decrease rework, increase transparency into your application and increase the rate at which you can ship high quality software throughout the application lifecycle
As was introduced in the Microsoft Monitoring Agent blog post, the Microsoft Monitoring Agent provides a new capability to monitor IIS hosted applications and record performance violations in your application. Refer to the previous post and this MSDN article for details on using the Microsoft Monitoring Agent for monitoring your application and creating an IntelliTracefile.
After opening an IntelliTrace file that was created using the Microsoft Monitoring Agent running in monitoring mode you will see a Performance Data section that lists all of the recorded events that occurred when you application exceeded the performance threshold (default 5 seconds).
On the summary page you will see the entry point that triggered the violation. The following fields are shown in the Performance Data section:
Selecting a row and either double clicking or clicking the “View Details” button will take you to the details page for the performance event, a screenshot of which you can see next.
In the above screenshot you will see three sections.
Details – this section contains additional details about the process or machine that were captured by the agent. It is collapsed by default. Below is an expanded view.
Slowest Calls – this section lists up to 5 slowest calls that were detected when this entry point executed. They are listed in order of slowness. Clicking the “Find in Tree” link will expand the execution tree in the section below, if necessary, to show where the call occurred in the recorded execution tree.
Execution Tree – The execution tree is a tree of the calls that occurred and were recorded during the performance degradation. This tree can be very deep with many branches. The “Expand All” link will fully expand all of the calls in the tree as shown below.
The slowest calls are identified using red text.
Some of the calls will have additional data available to aid in debugging and diagnosing the problem. These are indicated by the expansion icon on the Method Name. In the below screenshot the Action Execution: Home Index call was expanded to show the additional information. From here you can easily see the controller and action that were triggered as part of this request. Often you will find even more information captured in the parameters item that will provide information like parameters and values provided to SQL calls.
For any call in the execution tree you can select the call and click the “Debug this event” button. Typically you will want to select calls that are relevant to code within your application such as the FabrikamFiber.Web.Controllers.HomeController.Index() call.
In this case since I have stored the matching symbol and source files for my monitored application I will resolve to the matching line of source code. So when I click the "Debug this event" button I see something like the following screenshot.
For detailed information on the Microsoft Monitoring Agent refer to TechNet.
For expanded scenarios and usage information refer to MSDN.
We are always looking for feedback and comments for our features. Please visit the MSDN Diagnostics forums.
if you can please the code and the method for this application
The application that I used is a slightly modified version of the Fabrikam Fiber application included with Brian Keller's VM available here: blogs.msdn.com/.../visual-studio-2013-application-lifecycle-management-virtual-machine-and-hands-on-labs-demo-scripts.aspx
The modification that I made was to the Index method on the CustomersController as shown in the screenshot above. I did this simply to add a bit more complexity to the code and add some more database calls.