產生效能 APM 事件的警示

Microsoft.SystemCenter.Apm.ApplicationInstance.AlertPerformanceAspectRule (Rule)

Knowledge Base article:

摘要

如果在定義的期間內效能事件的總數超過監視閾值,執行個體狀態會變為狀況不良。

原因

執行時間超出設定的警示閾值時,系統會產生應用程式效能警示。警示詳細資料會將執行時間細分為各類型函式呼叫所費時間的百分比。資料庫的呼叫時間過長可能是因為資料庫伺服器或查詢的結構與複雜度出現問題。檔案 I/O 的時間過長可能是因為檔案伺服器發生問題。Web 服務的效能問題可能是由於 Web 服務或該服務所在伺服器已關機,或是 Web 服務程式碼有問題。應用程式的內部執行時間過長可能是由於程式碼太過複雜或缺乏效率。

解決方式

執行時間超出設定的閾值時,系統會產生應用程式效能警示。一般應用程式效能降低可能是因為資料庫呼叫時間過長、Web 服務呼叫時間過長、.NET 遠端呼叫或 COM+ 呼叫太慢或是應用程式碼缺乏效率。

您可以使用 [警示內容] 索引標籤上 [警示描述] 中事件詳細資料中提供的連結來存取與此警示相關的其他詳細資訊。該連結將會在 [Application Diagnostics] 主控台中開啟事件。[Application Diagnostics] 主控台內含與此事件相關的資訊,以及偵測到的相關及類似事件。

Element properties:

TargetMicrosoft.SystemCenter.Apm.ApplicationInstance
CategoryAlert
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableFalse
Alert Message
伺服器效能例外狀況
'{0}' 已超過設定的閾值 {1} 毫秒:{2}. 如需詳細資訊,請使用下列連結:$Url[Query='{3}']/APMEvent$

Member Modules:

ID Module Type TypeId RunAs 
LOBProvider DataSource Microsoft.SystemCenter.Apm.LobDataProvider Default
AlertWriteAction WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SystemCenter.Apm.ApplicationInstance.AlertPerformanceAspectRule" Enabled="false" ConfirmDelivery="true" Target="Microsoft.SystemCenter.Apm.ApplicationInstance" Remotable="false">
<Category>Alert</Category>
<DataSources>
<DataSource ID="LOBProvider" TypeID="Microsoft.SystemCenter.Apm.LobDataProvider">
<Name>$Target/Property[Type="Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/ApplicationName$</Name>
<AspectType>performance</AspectType>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="AlertWriteAction" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name='Microsoft.SystemCenter.Apm.ApplicationInstance.AlertPerformanceAspectRule.AlertMessage']$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventData/problemDescription$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="Microsoft.SystemCenter.Apm.ApplicationInstance"]/PerformanceThreshold$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</AlertParameter3>
<AlertParameter4>$Data/EventData/ViewDetail$</AlertParameter4>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/EventData/eventConsolidationHash$</SuppressionValue>
</Suppression>
<Custom1>Performance</Custom1>
</WriteAction>
</WriteActions>
</Rule>