为事务性能 CSM 事件生成警报

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

Knowledge Base article:

摘要

当配置的事务的客户端性能事件总数超出监视器阈值时,对象状态将变为不正常。

原因

当 Web 应用程序的页面加载时间超出所配置的阈值时,将生成客户端性能警报。 将在 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}. 已超出在 {3} 上针对事务 {4} 为 {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>