收集 .NET Apps/\% Performance Events/sec

Microsoft.SystemCenter.Apm.ApplicationInstance.PerformanceRateMonitor (UnitMonitor)

收集 .NET Apps/\% Performance Events/sec 效能計數器

Knowledge Base article:

摘要

若定義時間內的效能事件數超出監視閾值,執行個體的狀態會變為狀況不良。

原因

當效能的事件數超出設定的監視閾值時,系統會產生應用程式效能警示。

資料庫的呼叫時間過長可能是因為資料庫伺服出現問題,或是資料庫查詢的結構或複雜度有問題。檔案 I/O 的時間過長可能是因為檔案伺服器發生問題。Web 服務的效能問題可能是由於 Web 服務或該服務所在伺服器已關機,或是 Web 服務程式碼有問題。應用程式的內部執行時間過長可能是由於程式碼太過複雜或缺乏效率。

解決方式

一般應用程式效能降低的原因可能是由於資料庫呼叫時間過長、Web 服務呼叫時間過長、.NET 遠端呼叫太慢、COM+ 呼叫太慢或是應用程式碼的效率不佳。

Element properties:

TargetMicrosoft.SystemCenter.Apm.ApplicationInstance
Parent MonitorSystem.Health.PerformanceState
CategoryCustom
EnabledFalse
Instance Name.NET Apps
Counter Name\% Performance Events/sec
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeSystem.Performance.ConsecutiveSamplesThreshold
RemotableFalse
AccessibilityPublic
Alert Message
.NET Apps/\% Performance Events/sec 超過閾值
.NET Apps/\% Performance Events/sec 效能計數器已超過設定的閾值 {0}\%。效能計數器值為 {1}\%。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.Apm.ApplicationInstance.PerformanceRateMonitor" Accessibility="Public" Enabled="false" Target="Microsoft.SystemCenter.Apm.ApplicationInstance" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="false" Priority="Normal" TypeID="Performance!System.Performance.ConsecutiveSamplesThreshold" ConfirmDelivery="false">
<Category>Custom</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.Apm.ApplicationInstance.PerformanceRateMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/PerformanceRateMonitorThreshold$</AlertParameter1>
<AlertParameter2>$Data/Context/SampleValue$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="ConditionFalse" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="ConditionTrue" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<CounterName>% Performance Events/sec</CounterName>
<ObjectName>.NET Apps</ObjectName>
<InstanceName>$Target/Property[Type="Microsoft.SystemCenter.Apm.ApplicationInstance"]/CounterInstance$</InstanceName>
<AllInstances>false</AllInstances>
<Frequency>$Target/Property[Type="Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/PerformanceRateMonitorInterval$</Frequency>
<Threshold>$Target/Property[Type="Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/PerformanceRateMonitorThreshold$</Threshold>
<Direction>greater</Direction>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>