Pages

5/27/2010

SharePoint 2010: Developer Dashboard Notes

 

If you have not seen the Developer Dashboard, then go GoogleBing it now. While working with it I found a few interesting issues… so what follows are miscellaneous notes that may help someone in the future.

The Dashboard is enabled using:

  • STSADM
  • PowerShell
  • or code

 

STSADM

STSADM is going away! PowerShell is the new admin tool… but that said, they did ship STSADM with SP 2010 and it can be used to enable the Developer Dashboard.

While the Dashboard can be enabled with STSADM, it is not listed in help! (“stsadm -help setproperty”  does not list it!)  So you will need to make note of the syntax or bookmark the TechNet page.  Speaking of which, I can’t find a page on TechNet or MSDN that officially documents this option. It does get mention in a few places, like here: http://msdn.microsoft.com/en-us/library/ff512745.aspx

Here’s what I can find:

   stsadm -o setproperty -pn developer-dashboard -pv on

   stsadm -o setproperty -pn developer-dashboard -pv off

   stsadm -o setproperty -pn developer-dashboard -pv ondemand

 

PowerShell

The “Official” example here shows this PowerShell example:

    (Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”On”

Only thing is… it does not work.  (Maybe it worked in one of the betas)

Here is a good discussion about the feature, and how to create your own cmdlet for the Dashboard:
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=189

 

Here’s the PowerShell command from that blog article:

$dash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;

$dash.DisplayLevel = 'OnDemand';

$dash.TraceEnabled = $true;

$dash.Update()

 

(a lot to type, so create your own script or follow the blog article above to create a cmdlet)

Note: The SPWebService in the command above is not a “Web Services” reference. SPWebService is part of the hierarchy of SharePoint:   Farm –> Service –> Application –> Site Collection –> Web –> lists, etc.  SPWebService is one of many SharePoint “services”. SPWebService is responsible for the rendering of web pages.

 

Code

Here’s a C# example of turning the Dashboard on:

SPWebService ws = SPWebService.ContentService;
ws.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.OnDemand;
ws.DeveloperDashboardSettings.TraceEnabled = true;  //optional, but pretty cool (try it!)
ws.DeveloperDashboardSettings.Update();

 

DeveloperDashboardSettings

The DeveloperDashboardSettings is an interesting object. Here’s some of the methods and properties:

Methods:

  • DisableDiagnosticMode
  • EnableDiagnosticMode

Properties (and their defaults)

  • DisplayLevel                                  : Off
  • TraceEnabled                                : False
  • AutoLaunchEnabled                     :  False
  • RequiredPermissions                  : AddAndCustomizePages
  • MaximumSQLQueriesToTrack    : 50
  • MaximumCriticalEventsToTrack  : 50
  • AdditionalEventsToTrack              : {}

 

Instead of duplicating what someone else has done an excellent job of, I’ll list the few things above as a teaser and then refer you to this blog article by Geoff Varosky:
    http://gvaro.spaces.live.com/blog/cns!B06529FD3FC75473!928.entry?sa=54522551

 

.

 

Developer Dashboard Test 1

Developer Dashboard Test 2

Developer Dashboard Test 3

Developer Dashboard Test 4

Developer Dashboard Test 5

No comments:

Post a Comment

Note to spammers...
Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.