收集 .NET CSM Apps/平均執行時間 (毫秒)

Microsoft.SystemCenter.Apm.CsmApplicationInstance.AvgRequestTimeMonitor (UnitMonitor)

收集 .NET CSM Apps/平均執行時間效能計數器 (毫秒)

Knowledge Base article:

摘要

如果在定義的期間內,網頁於瀏覽器上載入的平均要求時間超過監視閾值,執行個體狀態會變為狀況不良。

原因

應用程式效能警示會在用戶端效能的平均持續時間超過設定的監視閾值時產生。

過長的網路要求時間可能是因為不平衡的網路所導致。

長時間的伺服器處理情形可能是由於複雜或效率不佳的原始碼所造成。

發生頁面載入時間效能問題可能是因為網頁過大或大量的 Java 指令碼所致。

Window.OnLoad 效能不佳問題可能是因為長時間執行 JavaScript 處理常式所造成。

解決方式

一般頁面載入呼叫時間過長情形可能是由於不平衡的網路、伺服器處理時間過長、頁面載入時間過長或 Window.OnLoad 時間過長。

Element properties:

TargetMicrosoft.SystemCenter.Apm.CsmApplicationInstance
Parent MonitorSystem.Health.PerformanceState
CategoryCustom
EnabledFalse
Instance Name.NET CSM Apps
Counter NameAverage page request execution time
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeSystem.Performance.ConsecutiveSamplesThreshold
RemotableFalse
AccessibilityPublic
Alert Message
.NET CSM Apps/Avg.Request Time 超過閾值。
.NET CSM Apps/平均執行時間效能計數器超過設定閾值 {0} 毫秒。效能計數器值為 {1} 毫秒。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.Apm.CsmApplicationInstance.AvgRequestTimeMonitor" Accessibility="Public" Enabled="false" Target="Microsoft.SystemCenter.Apm.CsmApplicationInstance" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="false" Priority="Normal" TypeID="Performance!System.Performance.ConsecutiveSamplesThreshold" ConfirmDelivery="false">
<Category>Custom</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.Apm.CsmApplicationInstance.AvgRequestTimeMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/AvgRequestTimeMonitorThreshold$</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>Average page request execution time</CounterName>
<ObjectName>.NET CSM Apps</ObjectName>
<InstanceName>$Target/Property[Type="Microsoft.SystemCenter.Apm.CsmApplicationInstance"]/CounterInstance$</InstanceName>
<AllInstances>false</AllInstances>
<Frequency>$Target/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/AvgRequestTimeMonitorInterval$</Frequency>
<Threshold>$Target/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/AvgRequestTimeMonitorThreshold$</Threshold>
<Direction>greater</Direction>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>