There are many good articles on the web covering ASP.NET Page LifeCycle – published my Microsoft on MSDN or by professionals in .NET related blogs. Dynatrace allowed me to dive deeper into the Page LifeCycle seeing the impact of my implemented OnInit, OnPreRender, … methods of my pages, web parts and controls when my application actually runs under production load.

In order to do Application Performance Management you have to understand all the libraries, frameworks and 3rd party software that you use in your application. ASP.NET is the main framework that you work. So you better understand what is going on when a page request is executed in order to know where not to do costly code executions.

ASP.NET Extended Knowledge Sensor

I’ve created a new Knowledge Sensor Pack that extends the out of the box ASP.NET Sensors. It includes support for ASP.NET Pages, WebParts, Custom Controls and ViewState handling. Using this KSP to analyse DotNetPay – dynaTrace’s .NET Sample Application – gives us the following diagnostics information:

API Breakdown

Performing a Outside-In Diagnose, I start with the API Breakdown. The API Breakdown shows us the main performance contributors of an ASP.NET Page Request:

ASP.NET Page Request API Breakdown
ASP.NET Page Request API Breakdown

I can see the performance broken down into the different layes:

  • ASP.NET WebPage
  • ASP.NET UserControls
  • ASP.NET ViewState
  • and general ASP.NET

It turns out that my custom ASP.NET Controls have a major impact on the overall performance.

Identifying poor performing Custom ASP.NET Controls

From the API Breakdown View I switch to the Method View. This view allows us to get an overview of those methods that actually contribute to the bad performance.

List of custom ASP.NET methods
List of custom ASP.NET methods

From an individual method we can then get to the PurePath to analyse the reason of the bad performance

Analysing root cause of slow custom ASP.NET Controls

The PurePath shows us where in the ASP.NET Page LifeCycle my custom control was actually executed and why the overall execution time of this control was slow

Shows the PurePath of slow performing Custom ASP.NET Control
Shows the PurePath of slow performing Custom ASP.NET Control

Conclusion 

Getting insight into the used frameworks is crucial for you in order to write performing and scalable applications. dynaTrace gives you the option to see behind the curtains.