11.3. System/JVM metrics

  1. AverageSystemLoadMetric
    • Returns CPU load
    • Requires Java 1.6+.
    • Uses OperatingSystemLoadMetricSource to generically read attributes
    For example:
    <bean name="AverageSystemLoadMetric" class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand">
      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=AverageSystemLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
      <constructor>
        <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
      </constructor>
    </bean>
    <bean name="OperatingSystemLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand">
    </bean>
  2. SystemMemoryUsageLoadMetric
    • Returns system memory usage
    • Requires com.sun.management.OperatingSystemMXBean (available in Sun's JDK or OpenJDK)
    • Uses OperatingSystemLoadMetricSource to generically read attributes
    For example:
    <bean name="SystemMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand">
      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=SystemMemoryUsageLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
      <constructor>
        <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
      </constructor>
    </bean>
  3. HeapMemoryUsageLoadMetric
    • Returns the heap memory usage as a percentage of max heap size
    For example:
    <bean name="HeapMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand">
      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=HeapMemoryUsageLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
    </bean>