Showing posts with label Developer Dashboard. Show all posts
Showing posts with label Developer Dashboard. Show all posts

25 February, 2014

How to monitor SharePoint – Part -2


If you have any queries / questions regarding the first part then please feel free to ask so that we can discuss and proceed further…

We are going to discuss the remaining sections today in descriptive manner-

Usage data and health data collection
 As we discussed, ULS, Event Viewer logs, SharePoint Health Analyzer are vital enough to provide the cause behind the issues but sometimes not everything gets captured inside these logs, example-

1.   Traffic Reports - How many hits a page got, how the user got there, and what browser they used to get there.
2.   Search Reports - What was searched for, top clicks, failed queries.
3.   Inventory Reports - What space is being used by whom, how many sites you have, what languages those sites use.

"Site usage reports" have been renamed as Web Analytics.

You can access Web Analytics reports by going to Site Actions -> Site Settings.  Under the Site Actions heading you will see two links, Site Web Analytics Reports and Site Collection Web Analytics Reports.

Inventory Reports:
The inventory reports are targeted to help the site administrators in managing the site by keeping track of the site structure and storage and version issues.

1.   How much disk space is being consumed?
2.   How many sites have been created?
3.   What languages are in use?

Developer Dashboard

Developer Dashboard is one of the clean and neat tools to troubleshoot performance issues. This functionality is disabled by default but pretty useful. With the help of developer dashboard (DD), we can easily recognize type of problem, either programmatically by using the object model or visually by looking at page output, critical events, database queries, service calls, and SharePoint requests allocation.

How to enable this:-
$svc=[Microsoft.SharePoint.Administration.SPWebService]::ContentService
$ddsetting=$svc.DeveloperDashboardSettings
$ddsetting.DisplayLevel=[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$ddsetting.Update()

Best Practices on Memory Leak
Microsoft has created an awesome too to find out the memory leaks.


If you have any questions/queries then please let me know. I would be more than happy to help you as well as resolves your issues, Thank you.

Product applies to:
a.    SharePoint Server 2010
b.    SharePoint Foundation 2010

References:
Capacity requirements for the Web Analytics Shared Service in SharePoint Server 2010: http://technet.microsoft.com/en-us/library/gg440601.aspx

Reporting and usage analysis overview (SharePoint Server 2010)

Web Analytics in SharePoint 2010: Insights into Reports and Metrics

11 February, 2013

Customizing the SharePoint 2013 Developer Dashboard using custom scripts

Wow Stefan Gobner has shared a wonderful article on Customising Dev Dash in 2013.

In SharePoint 2013 Dev dash has helped the admins to help troubleshoot a lot of performance issues .
 The Developer Dashboard can now be extended by injecting custom JavaScript code into the developer dashboard window.

Two steps are necessary to achieve this:

1.Custom JavaScript code, which interacts with the developer dashboard DOM, has to be added to a script file that can be accessed from the Developer Dashboard page. E.g. by placing the script file into the _layouts/15 directory.

2.The custom script file(s) have to be registered to be loaded into the Developer Dashboard page.
Below is a short example, which hides the ULS tab in the Developer Dashboard. This example also shows how to use jquery within the Developer Dashboard.

Create the custom logic in a script file

Create a "hideULSTab.js" inside the layouts/15 directory (program files\common files\microsoft shared\web server extensions\15\template\layouts) and add the following script code to it:
// register a code block that runs after the page is loaded
$(document).ready(function()
{
   // iterate over all tabs (identified by CSS class "ms-dd-Tab")
   $('.ms-dd-Tab').each(function(index, para)
   {
      // look for the tab which has "ULS" title
      if ($(para).text().indexOf("ULS") !== -1)
      {
         // hide the title
         $(para).hide();
      }
   });
});

Register the script files with the Developer Dashboard

Our custom script code requires the jquery library – so we have to register two script files with the developer dashboard. That can be done using the following powershell commands:

$contentSvc = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService)
$DevDashboardSettings = $contentSvc.DeveloperDashboardSettings
$DevDashboardSettings.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On

$DevDashboardSettings.userscripts.Add("http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.0.min.js")
$DevDashboardSettings.userscripts.Add("/_layouts/15/hideULSTab.js")

$DevDashboardSettings.Update()

As you can see we are registering two different script files: first the jquery library from an external site and second the script file we created earlier.

The powershell script will also enable the Developer Dashboard by setting the DisplayLevel to On.

http://blogs.technet.com/b/stefan_gossner/archive/2013/01/23/customizing-the-sharepoint-2013-developer-dashboard-using-custom-scripts.aspx

31 January, 2013

Enabling and Using Developer Dashboard - Sharepoint 2010

Today I was working with one Client who was having some issues with performance . In Sharepoint 2010 . I found a Out of box Feature which helps in monitoring the performance of the site Developer Dashboard.

The Developer Dashboard is an instrumentation framework introduced in Microsoft SharePoint Foundation 2010. Similar in concept to ASP.NET page tracing, it provides diagnostic information that can help a developer or system administrator troubleshoot problems with page components that would otherwise be very difficult to isolate.

For example, a developer can easily introduce extra SPSite or SPWeb objects into his or her code unknowingly or add extraneous SQL Server queries.

In the past, the only way to debug performance problems caused by the extra overhead of these instances in code would be to attach a debugger to the code and monitor SQL Server Profiler traces. With the Developer Dashboard, a developer can identify this type of problem, either programmatically by using the object model or visually by looking at page output.

Although performance issues and resource usage information is available in the Unified Logging Service (ULS) logs, interpreting the raw data can be very time consuming. With the Developer Dashboard, all the related information is correlated, which makes identifying these types of issues much easier.

How to enable Developer Dashboard and how to use this?

Enable / Disable over stsadm:

stsadm -o getproperty -pn developer-dashboard



stsadm –o setproperty –pn developer-dashboard –pv “On”





Enable / Disable over powershell

Turn On: for onDemain Mode
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$addsetting.Update()


Turn On
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$addsetting.Update()


Turn Off
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$addsetting.Update()
 


On – Displays the output all the time at the end of the page content
Off – Switch off Developer Dashboard and nothing is rendered
OnDemand – Displays a DeveloperDashboard icon to make dashboard output visible if needed.

In ON Demand - you will see a icon on the top right hand side corner of the site . as Shown below .



also you will see the following details when you click on the icon .



How to use the Developer Dashboard?
Developer dashboard is designed to find performance bottleneck during the page load.
To get an overview about the whole page load performance take a look in the upper right side  on category “web server”. On my test environment the total time of page rendering  is 3801.71 milli seconds.





At the left side you will see the ASP.NET rendering process of all involved controls with their time to render. Here is makes sense to focus only on long running controls.






In this case the longest operation is GetWebPartPageContent (1815.92 ms)

Because sharepoint controls will request data from database, the developer dashboard lists also corresponding sql requests with their execution time.



If you click on the sql command than a popup windows display more details. The long running sql request on my test environment is “Declare @…”





During this request i see the complete SQL query and the corresponding call stack to identify the correct control. Additionally at the end we see the IO Stats in case of a slow running SQL server based on too many IO-operations. 


One additional category exist for webparts to identify the slow running ones. In this case the ListView-Webaprt of the “Shared Document Library” is the slowest one.


Hope This Post helps administrators on resolving Performance issues .



Reference sites- http://msdn.microsoft.com/en-us/library/ff512745(v=office.14).aspx

http://blogs.technet.com/b/patrick_heyde/archive/2009/11/16/sharepoint-2010-enable-using-developer-dashboard.aspx