Jaap Vossers' SharePoint Blog

Just another WordPress.com site

How to interpret the information in the Developer Dashboard in SharePoint 2010

with 3 comments

When I first had a look at the Developer Dashboard in SharePoint 2010 I was a bit confused. The numbers shown in the nested unordered list on the left, representing load times in milliseconds, didn’t seem to actually cover 100% of the the request that was being handled. Basically it turns out that there are “gaps” that are not monitored, which is exactly why the sum of execution times for a certain set of child nodes in the list often don’t match the execution time of the parent. This is due to the SPMonitoredScope model.

Each node in the list represents a SPMonitoredScope that was created, either in SharePoint OOTB code or in code that you wrote yourself. When a second SPMonitoredScope is created before the first one is disposed, the second one will be treated as a child scope of the first one. In the context of a web request, the top level scope is instantiated in the SPRequestModule. Scopes that you instantiate yourself will most likely become child scopes of this “Request scope”.

Lets look at an example for a custom Visual WebPart that creates it’s own scopes.

   1:  protected void VisualWebPart1_Load(object sender, EventArgs e)
   2:  {
   3:      using (SPMonitoredScope mainScope = new SPMonitoredScope("VisualWebPart1_Load mainScope"))
   4:      {
   5:          Thread.Sleep(5000); // some processing that is not inside a subscope
   6:   
   7:          using (SPMonitoredScope subScope1 = new SPMonitoredScope("VisualWebPart1_Load subScope1"))
   8:          {
   9:              Thread.Sleep(1000);
  10:          }
  11:   
  12:          using (SPMonitoredScope subScope2 = new SPMonitoredScope("VisualWebPart1_Load subScope2"))
  13:          {
  14:              Thread.Sleep(1000);
  15:          }
  16:   
  17:          using (SPMonitoredScope subScope3 = new SPMonitoredScope("VisualWebPart1_Load subScope3"))
  18:          {
  19:              Thread.Sleep(1000);
  20:          }
  21:      }
  22:  }

Now let’s look at the resulting Developer Dashboard output.

scopes

Do you see what I mean?

Now on  a similar note, I have been working on a project that visualizes the data rendered by the Developer Dashboard. It’s just not easy enough to spot “peaks” without it. 

As you might have guessed, it’s a jQuery based solution. I am hoping to put it on CodePlex soon. Here is a sneak peek (click to enlarge):

devdashvis1

Written by jvossers

November 27, 2009 at 4:44 pm

3 Responses

Subscribe to comments with RSS.

  1. The SP+JQuery genius does it again! Good work mate

    Stuart Starrs

    November 28, 2009 at 9:53 pm

  2. […] As announced before, I have been working an open source project that visualizes the data in the Developer Dashboard in SharePoint 2010. […]

  3. […] As announced before, I have been working an open source project that visualizes the data in the Developer Dashboard in SharePoint 2010. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: