Share via


SPMonitoredScope constructor (String, UInt32, ISPScopedPerformanceMonitor[])

Creates a set of monitors and initializes them for use with a given scope using a specified friendly name and for a given duration of operation.

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

Syntax

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

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

Parameters

  • name
    Type: System.String

    A friendly name for the scope to be monitored.

  • maximumExecutionTime
    Type: System.UInt32

    The maximum duration of the monitoring operation, in milliseconds.

  • monitors
    Type: []

    The list of monitors to be used in the monitoring operation.

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. If monitoring the scope exceeds the time represented by the maximumExecutionTime value, you can use the maximumExecutionTime value to increase the logging level.

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