SPSystemPerformanceCounterMonitor Constructor (String, String, String, SPSystemPerformanceCounterRelativeInstance)
Initializes a new instance of the SPSystemPerformanceCounterMonitor class for the specified computer by using the specified category and counter names, and by using the specified instance naming hint.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Sub New ( _
computer As String, _
category As String, _
counter As String, _
instanceEnum As SPSystemPerformanceCounterRelativeInstance _
)
'Usage
Dim computer As String
Dim category As String
Dim counter As String
Dim instanceEnum As SPSystemPerformanceCounterRelativeInstance
Dim instance As New SPSystemPerformanceCounterMonitor(computer, _
category, counter, instanceEnum)
public SPSystemPerformanceCounterMonitor(
string computer,
string category,
string counter,
SPSystemPerformanceCounterRelativeInstance instanceEnum
)
Parameters
computer
Type: System.StringThe name of the computer that is monitored.
category
Type: System.StringThe category of monitor, such as “Processor” or “SharePoint Foundation Search Gatherer.”
counter
Type: System.StringThe name of the particular characteristic that is being measured, such as “% Idle Time” or “Active Queue Length.”
instanceEnum
Type: Microsoft.SharePoint.Utilities.SPSystemPerformanceCounterRelativeInstanceA value that specifies whether the instance is named after the process, such as “w3wp”, or the SharePoint Foundation Web application, such as “SharePoint – 80”.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Either category or counter is a null reference (Nothing in Visual Basic). |
Remarks
If computer is not the local computer, the calling code must be running in the context of a user who:
Is in the performance monitor group of the remote computer.
Has Read permission for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg on the remote computer.
See Also
Reference
SPSystemPerformanceCounterMonitor Class
SPSystemPerformanceCounterMonitor Members