SPHttpThrottleSettings.PerformanceMonitors property
Obtém persistentes informações de configuração sobre os monitores de desempenho do aplicativo da Web pai.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaração
Public ReadOnly Property PerformanceMonitors As SPHttpThrottlingMonitors
Get
'Uso
Dim instance As SPHttpThrottleSettings
Dim value As SPHttpThrottlingMonitors
value = instance.PerformanceMonitors
public SPHttpThrottlingMonitors PerformanceMonitors { get; }
Property value
Type: Microsoft.SharePoint.Utilities.SPHttpThrottlingMonitors
As informações de configuração de monitores de desempenho.
Comentários
Compare essa propriedade com o objeto retornado pelo método GenerateMonitors() . Essa última contém dados atualmente está sendo relatados por monitores de desempenho. Assim para ler os valores atuais dos monitores, o código necessário chamar o método GenerateMonitors() . Mas, para alterar a configuração de um monitor, o código necessário chamar a propriedade PerformanceMonitors .
Examples
O exemplo a seguir mostra essa propriedade em uso. Para o exemplo completo, consulte How to: Create, Modify, and Change a Bucket Style Health Score Calculator.
Uri webApplicationUri = new Uri("Http://localhost/");
SPWebApplication webApplication = SPWebApplication.Lookup(webApplicationUri);
SPHttpThrottleSettings throttleSettings = SPHttpThrottleSettings.GetHttpThrottleSettings(webApplication);
SPHttpThrottlingMonitors myMonitors = throttleSettings.PerformanceMonitors;
foreach (SPPerformanceMonitorCreationData creationData in myMonitors)
{
if (creationData.Category == "Processor" & creationData.Counter == "% Processor Time" & creationData.Instance == "0")
{
SPBucketHealthScoreCalculator bucketScoreCalculator = (SPBucketHealthScoreCalculator)creationData.AssociatedHealthScoreCalculator;
}
}
Dim webApplicationUri As New Uri("Http://localhost/")
Dim webApplication As SPWebApplication = SPWebApplication.Lookup(webApplicationUri)
Dim throttleSettings As SPHttpThrottleSettings = SPHttpThrottleSettings.GetHttpThrottleSettings(webApplication)
Dim myMonitors As SPHttpThrottlingMonitors = throttleSettings.PerformanceMonitors
For Each creationData As SPPerformanceMonitorCreationData In myMonitors
If creationData.Category = "Processor" & creationData.Counter = "% Processor Time" & creationData.Instance = "0" Then
Dim bucketScoreCalculator As SPBucketHealthScoreCalculator = CType(creationData.AssociatedHealthScoreCalculator, SPBucketHealthScoreCalculator)
End If
Next creationData