.NET Statistic/Avg execution time (ミリ秒) の収集

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

.NET Statistic/Avg execution time パフォーマンス カウンター (ミリ秒) を収集します。

Knowledge Base article:

概要

定義された期間の平均要求時間がモニターのしきい値を超えると、インスタンスの状態が異常になります。

原因

トランザクションのパフォーマンス アラートは、パフォーマンス イベントの数が、構成されたモニターのしきい値を超えた場合に生成されます。

データベースの呼び出しに長時間かかる場合は、サーバーの問題や、クエリの構造と複雑さが原因の可能性があります。ファイル I/O 時間が長い場合は、ファイル サーバーに問題があることが考えられます。Web サービスのパフォーマンスの問題は、Web サービス、またはそのサービスが常駐しているサーバーがダウンしているか、Web サービスのコードの問題が原因で発生することがあります。アプリケーションの内部実行時間が長い場合は、コードが複雑なことや効率がよくないことが考えられます。

解決方法

通常、アプリケーション パフォーマンスの劣化の原因には、データベースの呼び出しや Web サービスの呼び出しに長時間かかること、.NET リモート処理の呼び出しや COM+ の呼び出しが遅いこと、アプリケーション コードの効率がよくないことが考えられます。

Element properties:

TargetMicrosoft.SystemCenter.Apm.Transaction
Parent MonitorSystem.Health.PerformanceState
CategoryCustom
EnabledFalse
Instance Name.NET Statistic
Counter NameAvg execution time
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeSystem.Performance.ConsecutiveSamplesThreshold
RemotableFalse
AccessibilityPublic
Alert Message
.NET Statistic/Avg execution time がしきい値を超えました
.NET Statistic/Avg execution time パフォーマンス カウンターが、構成されているしきい値 ({0} ミリ秒) を超えました。パフォーマンス カウンターの値は {1} ミリ秒です。
RunAsDefault

Source Code:

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