SPHttpThrottleSettings.RemovePerformanceMonitor 方法 (String, String, String)
从PerformanceMonitorsSPHttpThrottleSettings对象的集合中移除性能监视器使用指定的计数器名称、 实例名称和类别。
命名空间: Microsoft.SharePoint.Utilities
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Sub RemovePerformanceMonitor ( _
category As String, _
counter As String, _
instance As String _
)
用法
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
)
参数
category
类型:System.String被删除的监视器类别。
counter
类型:System.String被删除的计数器的名称。
instance
类型:System.String移除计数器的实例名称。
备注
如果有多余的性能监视器对象 ;也就是说,多个使用相同的类别、 计数器和实例名称,然后删除所有。
若要删除所有性能监视RemovePerformanceMonitor(String, String)重载此方法的一个计数器的所有实例。
示例
下面的代码示例演示在使用此方法。有关完整的示例,请参见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")