PowerShell command to get Resource Count for SP 2010
One of my colleagues @ Microsoft happen to ask this quesiton for Sharepoint 2010 on Resource allocation for Sandboxed Solution
The default quota is 300 server resources, how to understand it ? ( or Server Points ?)
How to calculate them ?.
ANSWER:
The default Resourcing system is divided into 14 measures and if you want to get the details on what is the Resource Count of each measure (like threadabort,memory, AbnormalProcessTermination, CriticalExceptionCount, etc) you will need to run following PowerShell command:
Try following on the PowerShell console to get the measure details:
***************************************************************************************************************************************
Add-PSSnapin Microsoft.SharePoint.Powershell
[System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”)
$s=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$s.ResourceMeasures | Select-Object Name,ResourcePerPoint.
***************************************************************************************************************************************
Basically an output that looks like:
AbnormalProcessTerminationCount 1
CPUExecutionTime 3600
CriticalExceptionCount 10
InvocationCount 100
PercentProcessorTime 85
ProcessCPUCycles 100000000000
ProcessHandleCount 10000
ProcessIOBytes 0
ProcessThreadCount 10000
ProcessVirtualBytes 0
SharePointDatabaseQueryCount 20
SharePointDatabaseQueryTime 120
UnhandledExceptionCount 50
UnresponsiveprocessCount 2
This will give you the details on how much point are assigned per the 14 measures.