Share via


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)

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.String

    The name of the computer that is monitored.

  • category
    Type: System.String

    The category of monitor, such as “Processor” or “SharePoint Foundation Search Gatherer.”

  • counter
    Type: System.String

    The name of the particular characteristic that is being measured, such as “% Idle Time” or “Active Queue Length.”

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

SPSystemPerformanceCounterMonitor overload

Microsoft.SharePoint.Utilities namespace