You deploy a solution to a SharePoint server.
You need to implement a method to programmatically access the health score of the SharePoint Server.
Which three code segments should you use in sequence?
(To answer, move the appropriate segments from the list of segments to the answer area and arrange them in the correct order.)
Select and Place:
Correct Answer:
Explanation/Reference:
The Health Score is as an integer between 0 and 10, where 0 represents a really good health of the server, or rather Web Application, and 10 is where you do not want to be. SharePoint continuously calculates the Health Score and for each and every request the Health Score is sent as an HTTP Response Header, called X-SharePointHealthScore.
When building rich applications on SharePoint you have quite a few options. You can build Silverlight or Flash applications, those that are more JavaScript focused using things like jQuery or even the SPServices CodePlex project, or thick client apps using something like WPF. All of these apps can use the REST ListData.svc service or the client side object model (CSOM) to read and write to the various lists in your SharePoint site or (when using the CSOM) do even more things.
One thing about these remote calls back to SharePoint is that they can be slowed down if your SharePoint environment is under heavy load. This might confuse your users as they may have this very responsive application that slows down every time it needs to talk back to SharePoint.
Microsoft introduced a new little thing to help with this called the health score. What’s going on is that when you make a call to SharePoint, it adds a custom HTTP header to the response that tells you how the server is doing. This header, X-SharePointHealthScore, will be a number between 0 and 10.
The lower the number the less stressed the server is… the higher, the more taxed it is. As the number approaches 10 SharePoint will start to queue up
HTTP GET requests in order to handle the HTTP POST requests.
You could, to provide your users a good experience, indicate how the server is doing by looking at every other call. Here’s how you can do it:
http://www.wictorwilen.se/sharepoint-2013-sharepoint-health-score-and-throttling-deep-dive