垃圾回收时间

Microsoft.JEE.PerformanceHealth.GarbageCollectorTimeMonitor (UnitMonitor)

应用程序服务器的垃圾回收时间的性能监视器。

Knowledge Base article:

摘要

垃圾回收时间监视器跟踪垃圾回收器在与应用程序服务器关联的 Java 虚拟机上执行垃圾回收所用的时间。

原因

不正常状态表示垃圾回收器超过了为应用程序服务器配置的监视阈值。

垃圾回收时间超过阈值存在两种不同的原因:

解决方法

如果原因是资源不足造成的,则向 Java 虚拟机分配更多资源将使问题得到缓解。

如果原因是资源过多造成的,则从 Java 虚拟机中删除资源将使问题得到缓解。

Element properties:

TargetMicrosoft.JEE.GarbageCollector
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.JEE.ThresholdDeltaUnitMonitor
RemotableTrue
AccessibilityPublic
Alert Message
超过垃圾回收器时间监视器
对于以下应用程序服务器 ID,垃圾回收器时间监视器已超出其阈值:{0},对象名称:{1},计数器名称:{2},实例名称: {3}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.JEE.PerformanceHealth.GarbageCollectorTimeMonitor" Accessibility="Public" Enabled="false" Target="Microsoft.JEE.GarbageCollector" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.JEE.ThresholdDeltaUnitMonitor" ConfirmDelivery="true">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.JEE.PerformanceHealth.GarbageCollectorTimeMonitor_AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<!-- The alert description should include key properties of: -->
<!-- * the deep monitored application server -->
<!-- * the performance counter object name -->
<!-- * counter name -->
<!-- * instance name -->
<AlertParameter1>$Target/Host/Property[Type="Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Id$</AlertParameter1>
<AlertParameter2>Garbage Collector</AlertParameter2>
<AlertParameter3>JVM Garbage Collector Collection Time Change Rate</AlertParameter3>
<AlertParameter4>$Target/Property[Type="Microsoft.JEE.GarbageCollector"]/GarbageCollectorName$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Microsoft.JEE.PerformanceHealth.GC.Time.UnderThreshold" MonitorTypeStateID="UnderThreshold" HealthState="Success"/>
<OperationalState ID="Microsoft.JEE.PerformanceHealth.GC.Time.OverThreshold" MonitorTypeStateID="OverThreshold" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="Microsoft.JEE.ApplicationServer.Monitored.Instance"]/HostName$</ComputerName>
<Protocol>$Target/Host/Property[Type="Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Protocol$</Protocol>
<Port>$Target/Host/Property[Type="Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Port$</Port>
<BaseURL/>
<URLSuffix/>
<IntervalSeconds>900</IntervalSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<!-- Need to find the GCCollectionTime that has a sibling element -->
<!-- called GCName with a value of (for example) "PS Scavenge" -->
<!-- XPath should look like: -->
<!-- /Stats/GC/Properties/GCCollectionTime[../GCName = "PS Scavenge"] -->
<MetricName>/Stats/GC/Properties/GCCollectionTime[../GCName = "$Target/Property[Type="Microsoft.JEE.GarbageCollector"]/GarbageCollectorName$"]$</MetricName>
<!-- The spec says that a value of 1000ms per GC is the threshold -->
<!-- as the monitor cannot calculate the values a value of 5000ms -->
<!-- has been chosen for the 300 second monitor frequency -->
<!-- This equates to roughly 5 GC's per 300 seconds of under 1000ms each -->
<Threshold>5000</Threshold>
<SampleCount>2</SampleCount>
</Configuration>
</UnitMonitor>