產生交易效能 CSM 事件的警示

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

Knowledge Base article:

摘要

當設定交易的用戶端效能事件總數超過監視閾值時,物件狀態會變為狀況不良。

原因

用戶端效能警示會在 Web 應用程式的頁面載入時間超過設定的閾值時產生。 總時間是在網頁瀏覽器上衡量而得 (與伺服器處理時間相關),然後再將其區分為下列類別於事件詳細資料中提供:

當頁面載入時間超過閾值時:

當 AJAX 呼叫的回應時間超過閾值時:

在一個或多個類別中花費大量時間可能表示其主要原因為效能問題。 例如,花在處理網路要求和回應的時間可能表示網路連線能力過慢。 過長的伺服器回應時間可能是由於伺服器程式碼執行速度過慢,可以調查相關的伺服器端效能警示進行進一步的疑難排解。 DOM 載入過慢可能是因為應用程式頁面太過複雜或大小過大,也有可能是因為用戶端瀏覽器的效能不佳所致。 Window.OnLoad() 事件執行時間過久或 AJAX JavaScript 執行速度過慢表示頁面上的程式碼效率不佳,或是用戶端瀏覽器的效能不佳。 大量的頁面重新導向可能是因為應用程式程式碼太複雜或效能不佳。

解決方式

用戶端效能警示會在執行時間超過設定的閾值時產生。 一般應用程式效能降低的原因可能是 Web 伺服器的效能不佳、網路速度過慢或應用程式的程式碼效能不好。

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

Element properties:

TargetMicrosoft.SystemCenter.Apm.CsmWebPageTransaction
CategoryAlert
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableFalse
Alert Message
用戶端頁面效能例外狀況
{0}. 已超過針對交易 {4} 中 {3} 的 {2} 所設定的閾值 {1} 毫秒。 如需詳細資訊,請使用下列連結: $Url[Query='{5}']/APMEvent$

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SystemCenter.Apm.CsmWebPageTransaction.AlertPerformanceAspectRule" Enabled="false" ConfirmDelivery="false" Target="Microsoft.SystemCenter.Apm.CsmWebPageTransaction" Remotable="false">
<Category>Alert</Category>
<DataSources>
<DataSource ID="LOBProvider" TypeID="Microsoft.SystemCenter.Apm.Csm.CsmWebPageTransaction.LobDataProvider">
<Name>$Target/Host/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/ApplicationName$ (Client)</Name>
<AspectType>performance</AspectType>
<RootName>$Target/Property[Type="Microsoft.SystemCenter.Apm.CsmWebPageTransaction"]/PageName$</RootName>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="AlertWriteAction" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name='Microsoft.SystemCenter.Apm.CsmWebPageTransaction.AlertPerformanceAspectRule.AlertMessage']$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventData/log/properties/property[name="scomProblemDescription"]/value$</AlertParameter1>
<AlertParameter2>$Data/EventData/log/alertingThreshold$</AlertParameter2>
<AlertParameter3>$Target/Host/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/ApplicationName$</AlertParameter3>
<AlertParameter4>$Target/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</AlertParameter4>
<AlertParameter5>$Target/Property[Type="AL!Microsoft.SystemCenter.Apm.TransactionBase"]/TransactionName$</AlertParameter5>
<AlertParameter6>$Data/EventData/ViewDetail$</AlertParameter6>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/EventData/eventConsolidationHash$</SuppressionValue>
</Suppression>
<Custom1>Performance</Custom1>
</WriteAction>
</WriteActions>
</Rule>