The SharePoint Developer Dashboard is one of the many new features of SharePoint 2010.
It displays detailed diagnostic information for each pageload. Not only does is show you information about your code it also allows to to see each database query that has been executed.
The Developer Dashboard is off by default and can be enabled using powershell, stsadm.exe or the objectmodel. Once enabled a little icon will show up next to the accountname allowing you to show/hide the dashboard.
$DevDashboardSettings = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$DevDashboardSettings.DisplayLevel = ‘OnDemand’;
$DevDashboardSettings.RequiredPermissions =’EmptyMask’;
$DevDashboardSettings.TraceEnabled = $true;
$DevDashboardSettings.Update()
or
stsadm –o setproperty –pn developer-dashboard –pv OnDemand
or
SPPerformanceMonitor perfmon = SPFarm.Local.PerformanceMonitor;
perfmon.DeveloperDashboardLevel = SPPerformanceMonitoringLevel.On;
perfmon.Update();