Share via


SPMonitoredScope constructor (String, TraceSeverity, ISPScopedPerformanceMonitor[])

Creates a set of monitors and initializes them for use with a given scope using a specified friendly name and to monitor the provided scope for a given trace severity.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub New ( _
    name As String, _
    traceLevel As TraceSeverity, _
    ParamArray monitors As ISPScopedPerformanceMonitor() _
)
'Usage
Dim name As String
Dim traceLevel As TraceSeverity
Dim monitors As ISPScopedPerformanceMonitor()

Dim instance As New SPMonitoredScope(name, traceLevel, _
    monitors)
public SPMonitoredScope(
    string name,
    TraceSeverity traceLevel,
    params ISPScopedPerformanceMonitor[] monitors
)

Parameters

  • name
    Type: System.String

    The friendly name for the scope to be monitored.

  • monitors
    Type: []

    The array of monitors to be used to monitor the scope.

Remarks

The set of monitors that this constructor creates persists over the lifetime of the object.

Each monitor begins its monitoring work in its own constructor. The SPMonitoredScope object calls the Dispose method for each monitor and each monitor must stop its monitoring work within the scope of the Dispose method.

The associated Name, Description, and Value properties must remain accessible after the object is released.

See also

Reference

SPMonitoredScope class

SPMonitoredScope members

SPMonitoredScope overload

Microsoft.SharePoint.Utilities namespace