SPHttpThrottleSettings.RemovePerformanceMonitor Method (String, String, String)
Removes the performance monitor with the specified counter name, instance name, and category from the PerformanceMonitors collection of the SPHttpThrottleSettings object.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Sub RemovePerformanceMonitor ( _
category As String, _
counter As String, _
instance As String _
)
'Usage
Dim instance As SPHttpThrottleSettings
Dim category As String
Dim counter As String
Dim instance As String
instance.RemovePerformanceMonitor(category, _
counter, instance)
public void RemovePerformanceMonitor(
string category,
string counter,
string instance
)
Parameters
category
Type: System.StringThe category of the monitor that is removed.
counter
Type: System.StringThe name of the counter that is removed.
instance
Type: System.StringThe instance name of the counter that is removed.
Remarks
If there are redundant performance monitor objects; that is, more than one with the same category, counter, and instance names, then all are removed.
To remove all performance monitors for all instances of a counter use the RemovePerformanceMonitor(String, String) overload of this method.
Examples
The following sample code shows this method in use. For the complete example, see How to: Register or Deregister a Performance Counter.
Uri webApplicationUri = new Uri("Http://localhost/");
SPWebApplication webApplication = SPWebApplication.Lookup(webApplicationUri);
SPHttpThrottleSettings throttleSettings = SPHttpThrottleSettings.GetHttpThrottleSettings(webApplication);
// Remove the monitor
throttleSettings.RemovePerformanceMonitor("Processor",
"% Processor Time",
"_Total");
Dim webApplicationUri As New Uri("Http://localhost/")
Dim webApplication As SPWebApplication = SPWebApplication.Lookup(webApplicationUri)
Dim throttleSettings As SPHttpThrottleSettings = SPHttpThrottleSettings.GetHttpThrottleSettings(webApplication)
' Remove the monitor
throttleSettings.RemovePerformanceMonitor("Processor",
"% Processor Time",
"_Total")
See Also
Reference
SPHttpThrottleSettings Members