共用方式為


SPSystemPerformanceCounterMonitor Constructor (String, String, String, String)

Initializes a new instance of the SPSystemPerformanceCounterMonitor class for the specified computer by using the specified category, counter, and instance names.

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, _
    instance As String _
)
'Usage
Dim computer As String
Dim category As String
Dim counter As String
Dim instance As String

Dim instance As New SPSystemPerformanceCounterMonitor(computer, _
    category, counter, instance)
public SPSystemPerformanceCounterMonitor(
    string computer,
    string category,
    string counter,
    string instance
)

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

  • instance
    Type: System.String

    The name of the particular instance of the counter.

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.

If there is only one instance of the counter in the category, pass a null reference (Nothing in Visual Basic) or an empty string for instance.

See Also

Reference

SPSystemPerformanceCounterMonitor Class

SPSystemPerformanceCounterMonitor Members

SPSystemPerformanceCounterMonitor Overload

Microsoft.SharePoint.Utilities Namespace