Author: pferraro
Date: 2008-10-21 13:57:09 -0400 (Tue, 21 Oct 2008)
New Revision: 1970
Modified:
trunk/mod_cluster/src/main/resources/mod-cluster-jboss-beans.xml
Log:
Reorganized configuration, using new metric/source relationships.
Added default metrics/sources.
Added lots of comments.
Modified: trunk/mod_cluster/src/main/resources/mod-cluster-jboss-beans.xml
===================================================================
--- trunk/mod_cluster/src/main/resources/mod-cluster-jboss-beans.xml 2008-10-21 17:36:11
UTC (rev 1969)
+++ trunk/mod_cluster/src/main/resources/mod-cluster-jboss-beans.xml 2008-10-21 17:57:09
UTC (rev 1970)
@@ -1,299 +1,284 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Beans that provide JBoss AS-side functionality for mod_cluster. These
- beans are all "On Demand", i.e. that are not installed unless requested.
+ Beans that provide JBoss AS-side functionality for mod_cluster. These
+ beans are all "On Demand", i.e. that are not installed unless requested.
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- Configuration bean -->
- <bean name="ModClusterConfig"
- class="org.jboss.modcluster.config.ModClusterConfig"
- mode="On Demand">
-
- <!-- Configure this node's communication with the load balancer -->
-
- <!-- Comma separated list of address:port listing the httpd servers
- where mod_cluster is running.
- <property name="proxyList"></property>
- -->
- <!--URL prefix to send with commands to mod_cluster. Default is no prefix
- <property name="proxyURL">/bla</property>
- -->
-
- <!-- mod_advertise is a small httpd module that advertises the
- availability of httpd servers via multicast, allowing
- ModClusterService to discover the httpd front-end instead of/in
- addition to having them defined in proxyList.
- -->
- <!-- Whether to listen for advertise messages -->
- <property name="advertise">true</property>
- <!-- Multicast address to listen on for advertisements -->
- <!--property
name="advertiseGroupAddress">${jboss.modcluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property-->
- <!-- Port to listen to for advertisements -->
- <!--property
name="advertisePort">${jboss.modcluster.advertise.address:23364}</property-->
-
- <!-- Key the front-end is going to send with advertise messages.
- Default is no key no check.
- <property name="advertiseSecurityKey"></property>
- -->
-
- <!-- Whether to use SSL to communicate with mod_cluster. Note this
- has nothing to do with handling of https requests by JBoss Web -->
- <property name="ssl">false</property>
-
-
- <!-- Configuration values for the load balancer itself (must be the
- same on all nodes in the cluster). These will be passed to the
- load balancer. -->
- <property name="stickySession">true</property>
- <property name="stickySessionForce">false</property>
- <property name="stickySessionRemove">false</property>
- <property name="maxAttempts">-1</property>
- <property name="workerTimeout">-1</property>
-
- </bean>
-
- <!-- Provides information to ModClusterService informing it how much load
- this server should take. This basic impl just uses a static
- configuration and doesn't adjust it based on runtime conditions. -->
- <bean name="StaticModClusterLoadBalanceFactorProvider"
-
class="org.jboss.modcluster.load.impl.StaticLoadBalanceFactorProvider"
- mode="On Demand">
- <property name="loadBalanceFactor">1</property>
- </bean>
-
- <!-- Provides information to ModClusterService informing it how much load
- this server should take. This impl calculates load factor from a
- number of metrics and adjusts the value periodically based on runtime
- conditions. -->
- <bean name="DynamicModClusterLoadBalanceFactorProvider"
-
class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=LoadBalanceFactorProvider",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
- <constructor>
- <parameter>
- <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetricSource">
- <!-- Define the load metric sources to use in your load balance factor
calculation here -->
- <value><inject
bean="ThreadPoolLoadMetricSource"/></value>
- <value><inject
bean="HeapMemoryUsageLoadMetric"/></value><!-- N.B. This load metric
is its own source -->
- </collection>
- </parameter>
- </constructor>
- <!-- The number of historical load values used to determine load factor -->
- <!--property name="history">10</property-->
- <!-- The exponential decay factor for historical load values -->
- <!--property name="decayFactor">2</property-->
- </bean>
+ <!-- Configure this node's communication with the load balancer -->
+ <bean name="ModClusterConfig"
class="org.jboss.modcluster.config.ModClusterConfig" mode="On
Demand">
+
+ <!-- Comma separated list of address:port listing the httpd servers
+ where mod_cluster is running.
+ <!--property name="proxyList"></property-->
+ <!-- URL prefix to send with commands to mod_cluster. Default is no prefix.
+ <!--property name="proxyURL"></property-->
+
+ <!-- mod_advertise is a small httpd module that advertises the
+ availability of httpd servers via multicast, allowing
+ ModClusterService to discover the httpd front-end instead of/in
+ addition to having them defined in proxyList. -->
+ <!-- Whether to listen for advertise messages -->
+ <property name="advertise">true</property>
+ <!-- Multicast address to listen on for advertisements -->
+ <!--property
name="advertiseGroupAddress">${jboss.modcluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property-->
+ <!-- Port to listen to for advertisements -->
+ <!--property
name="advertisePort">${jboss.modcluster.advertise.address:23364}</property-->
+
+ <!-- Security key the proxy is going to send with advertise messages.
+ Default is none. -->
+ <!--property name="advertiseSecurityKey"></property-->
+
+ <!-- Whether to use SSL to communicate with mod_cluster. Note this
+ has nothing to do with handling of https requests by JBoss Web -->
+ <property name="ssl">false</property>
+
+ <!-- Configuration values for the load balancer itself (must be the
+ same on all nodes in the cluster). These will be passed to the
+ load balancer. -->
+ <property name="stickySession">true</property>
+ <property name="stickySessionForce">false</property>
+ <property name="stickySessionRemove">false</property>
+ <property name="maxAttempts">-1</property>
+ <property name="workerTimeout">-1</property>
+ </bean>
+
+ <!-- Provides information to ModClusterService informing it how much load
+ this server should take. This impl calculates load factor from a
+ number of metrics and adjusts the value periodically based on runtime
+ conditions, using to the JBossWeb engine's backgroundProcessorDelay. -->
+ <bean name="DynamicModClusterLoadBalanceFactorProvider"
class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=LoadBalanceFactorProvider",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
+ <constructor>
+ <parameter>
+ <!-- Define the load metric sources to use in your load balance factor
calculation here -->
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetricSource">
+ <value><inject
bean="ThreadPoolLoadMetricSource"/></value>
+ <value><inject
bean="HeapMemoryUsageLoadMetric"/></value>
+ </collection>
+ </parameter>
+ </constructor>
+ <!-- The number of historical load values used to determine load factor -->
+ <!--property name="history">10</property-->
+ <!-- The exponential decay factor for historical load values -->
+ <!--property name="decayFactor">2</property-->
+ </bean>
- <bean name="ThreadPoolLoadMetricSource"
-
class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource"
- mode="On Demand">
- <constructor>
- <parameter>
- <!-- Define the load metrics for this source to use in your load balance
factor calculation here -->
- <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
- <value><inject
bean="BusyConnectorsLoadMetric"/></value>
- </collection>
- </parameter>
- <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
- <!-- Object name pattern for connector thread pools -->
- <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
- </constructor>
- </bean>
- <bean name="BusyConnectorsLoadMetric"
-
class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=BusyConnectorsLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!-- The weight determines the significance of this metric with respect to
others in the overall load balance factor calculation -->
- <property name="weight">2</property>
- </bean>
- <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>
- <!-- By default, all metrics have a weight of 1 -->
- <!-- A metric with weight of 0 will be ignored -->
- </bean>
+ <!-- Default load metrics/sources -->
+ <!-- Queries all JBossWeb ThreadPool mbeans -->
+ <bean name="ThreadPoolLoadMetricSource"
class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource"
mode="On Demand">
+ <constructor>
+ <parameter>
+ <!-- Define the load metrics for this source -->
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <value><inject
bean="BusyConnectorsLoadMetric"/></value>
+ </collection>
+ </parameter>
+ <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
+ </constructor>
+ </bean>
+ <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max
thread pool size -->
+ <!-- Analogous to method=B in mod_jk -->
+ <bean name="BusyConnectorsLoadMetric"
class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=BusyConnectorsLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!-- The weight determines the significance of this metric with respect
+ to others in the overall load balance factor calculation -->
+ <property name="weight">2</property>
+ </bean>
+
+ <!-- The heap memory usage as a ratio of used heap to max heap size -->
+ <!-- N.B. This load metric is its own source -->
+ <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>
+ <!--property name="weight">1</property-->
+ </bean>
+
+ <!-- The core ModClusterService -->
+ <bean name="ModClusterService"
class="org.jboss.modcluster.ModClusterService" mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter><inject bean="HAPartition"/></parameter>
+ <parameter><inject
bean="ModClusterConfig"/></parameter>
+ <parameter><inject
bean="DynamicModClusterLoadBalanceFactorProvider"/></parameter>
+ <parameter><bean
class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/></parameter>
+ </constructor>
+ </bean>
+
+ <!--
+ An org.apache.catalina.LifecycleListener impl that notifies
+ ModClusterService of events inside JBoss Web (deployments, starts, stops. etc.)
+ -->
+ <bean name="ModClusterLifecycleListener"
class="org.jboss.modcluster.BasicClusterListener" mode="On
Demand">
+ <constructor>
+ <parameter><inject
bean="ModClusterService"/></parameter>
+ </constructor>
+ </bean>
- <!-- Other JBossWeb load metric sources -->
- <bean name="RequestProcessorLoadMetricSource"
-
class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"
- mode="On Demand">
- <constructor>
- <parameter>
- <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
- <value><inject
bean="RequestCountLoadMetric"/></value>
- <value><inject
bean="ReceiveTrafficLoadMetric"/></value>
- <value><inject
bean="SendTrafficLoadMetric"/></value>
- </collection>
- </parameter>
- <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
- <!-- Object name pattern for request processors -->
- <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
- </constructor>
- </bean>
- <bean name="SessionLoadMetricSource"
- class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource"
- mode="On Demand">
- <constructor>
- <parameter>
- <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
- <value><inject
bean="ActiveSessionsLoadMetric"/></value>
- </collection>
- </parameter>
- <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
- <!-- Object name pattern for session managers -->
- <!--parameter>jboss.web:type=Manager,*</parameter-->
- </constructor>
- </bean>
- <bean name="ConnectionPoolLoadMetricSource"
-
class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource"
- mode="On Demand">
- <constructor>
- <parameter>
- <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
- <value><inject
bean="ConnectionPoolUsageMetric"/></value>
- </collection>
- </parameter>
- <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
- <!-- Object name pattern for connector thread pools -->
-
<!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
- </constructor>
- </bean>
+ <!-- Alternative load balance factor providers -->
+
+ <!-- Basic impl that returns a static load balance factor -->
+ <bean name="StaticModClusterLoadBalanceFactorProvider"
class="org.jboss.modcluster.load.impl.StaticLoadBalanceFactorProvider"
mode="On Demand">
+ <property name="loadBalanceFactor">1</property>
+ </bean>
- <!-- Other metrics sources -->
- <bean name="OperatingSystemLoadMetricSource"
-
class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource"
- mode="On Demand">
- <constructor>
- <parameter>
- <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
- <value><inject
bean="AverageSystemLoadMetric"/></value>
- <value><inject
bean="SystemMemoryUsageLoadMetric"/></value>
- </collection>
- </parameter>
- </constructor>
- </bean>
+ <!-- Alternative load metrics, grouped by source -->
+
+ <!-- Uses the platform's OperatingSystemMXBean -->
+ <bean name="OperatingSystemLoadMetricSource"
class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource"
mode="On Demand">
+ <constructor>
+ <parameter>
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <value><inject
bean="AverageSystemLoadMetric"/></value>
+ <value><inject
bean="SystemMemoryUsageLoadMetric"/></value>
+ </collection>
+ </parameter>
+ </constructor>
+ </bean>
+ <!-- CPU usage -->
+ <!-- Perhaps the best metric for determining system load - but only available on
Java 1.6 or later -->
+ <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>
+ </bean>
+ <!-- The system memory usage as ratio of used memory to total memory size -->
+ <!-- Requires com.sun.management.OperatingSystemMXBean -->
+ <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>
+ </bean>
- <!-- System/JVM metrics -->
- <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>
- </bean>
- <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>
- </bean>
- <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>
- <bean name="ThreadCountLoadMetric"
- class="org.jboss.modcluster.load.metric.impl.ThreadCountLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ThreadCountLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!-- This metric requires an explicit capacity, e.g. max capacity of 300 threads
-->
- <property name="capacity">300</property>
- </bean>
- <bean name="ConnectionPoolUsageMetric"
-
class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ConnectionPoolUsageLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!--constructor>
- <parameter>InUseConnectionCount</parameter>
- <parameter>MaxSize</parameter>
- </constructor-->
- </bean>
- <!-- Analogous to method=R in mod_jk -->
- <bean name="RequestCountLoadMetric"
- class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=RequestCountLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!--constructor>
- <parameter>requestCount</parameter>
- </constructor-->
- <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000
requests/sec -->
- <property name="capacity">1000</property>
- </bean>
+ <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
+ <bean name="RequestProcessorLoadMetricSource"
class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"
mode="On Demand">
+ <constructor>
+ <parameter>
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <value><inject
bean="RequestCountLoadMetric"/></value>
+ <value><inject
bean="ReceiveTrafficLoadMetric"/></value>
+ <value><inject
bean="SendTrafficLoadMetric"/></value>
+ </collection>
+ </parameter>
+ <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
+ <!-- Object name pattern for request processors -->
+ <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
+ </constructor>
+ </bean>
+ <!-- The number of requests/sec processed by the JBossWeb connectors, with respect
to the defined capacity -->
+ <!-- Analogous to method=R in mod_jk -->
+ <bean name="RequestCountLoadMetric"
class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=RequestCountLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--constructor>
+ <parameter>requestCount</parameter>
+ </constructor-->
+ <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000
requests/sec -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to
the defined capacity -->
+ <!-- Analogous to method=T in mod_jk -->
+ <bean name="ReceiveTrafficLoadMetric"
class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ReceiveTrafficLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--constructor>
+ <parameter>bytesReceived</parameter>
+ </constructor-->
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s
-->
+ <property name="capacity">1024</property>
+ </bean>
+ <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the
defined capacity -->
+ <bean name="SendTrafficLoadMetric"
class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=SendTrafficLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--constructor>
+ <parameter>bytesSent</parameter>
+ </constructor-->
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s
-->
+ <property name="capacity">512</property>
+ </bean>
- <!-- Analogous to method=S in mod_jk -->
- <bean name="ActiveSessionsLoadMetric"
-
class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ActiveSessionsLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!--constructor>
- <parameter>activeSessions</parameter>
- </constructor-->
- <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active
sessions -->
- <property name="capacity">1000</property>
- </bean>
- <!-- Analogous to method=T in mod_jk -->
- <bean name="ReceiveTrafficLoadMetric"
-
class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ReceiveTrafficLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!--constructor>
- <parameter>bytesReceived</parameter>
- </constructor-->
- <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s
-->
- <property name="capacity">1024</property>
- </bean>
- <bean name="SendTrafficLoadMetric"
- class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=SendTrafficLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!--constructor>
- <parameter>bytesSent</parameter>
- </constructor-->
- <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s
-->
- <property name="capacity">512</property>
- </bean>
+ <!-- Queries all JBossWeb session manager mbeans -->
+ <bean name="SessionLoadMetricSource"
class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource"
mode="On Demand">
+ <constructor>
+ <parameter>
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <value><inject
bean="ActiveSessionsLoadMetric"/></value>
+ </collection>
+ </parameter>
+ <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
+ <!-- Object name pattern for session managers -->
+ <!--parameter>jboss.web:type=Manager,*</parameter-->
+ </constructor>
+ </bean>
+ <!-- The number of active sessions, with respect to the defined capacity -->
+ <!-- Analogous to method=S in mod_jk -->
+ <bean name="ActiveSessionsLoadMetric"
class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ActiveSessionsLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--constructor>
+ <parameter>activeSessions</parameter>
+ </constructor-->
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active
sessions -->
+ <property name="capacity">1000</property>
+ </bean>
- <!-- Analogous to method=B in mod_jk -->
- <bean name="BusyConnectorsLoadMetric"
-
class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric"
- mode="On Demand">
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=BusyConnectorsLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
- <!--constructor>
- <parameter>currentThreadsBusy</parameter>
- <parameter>maxThreads</parameter>
- </constructor-->
- </bean>
-
- <!-- The core ModClusterService -->
- <bean name="ModClusterService"
- class="org.jboss.modcluster.ModClusterService"
- mode="On Demand">
-
-
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
-
- <constructor>
- <parameter><inject bean="HAPartition"/></parameter>
- <parameter><inject
bean="ModClusterConfig"/></parameter>
- <parameter><inject
bean="DynamicModClusterLoadBalanceFactorProvider"/></parameter>
- <parameter><bean
class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/></parameter>
- </constructor>
-
- </bean>
-
- <!--
- An org.apache.catalina.LifecycleListener impl that notifies
- ModClusterService of events inside JBoss Web (deployments, starts, stops. etc.)
- -->
- <bean name="ModClusterLifecycleListener"
- class="org.jboss.modcluster.BasicClusterListener"
- mode="On Demand">
-
- <constructor>
- <parameter><inject
bean="ModClusterService"/></parameter>
- </constructor>
-
- </bean>
+
+ <!-- Queries all JCA connection pools -->
+ <bean name="ConnectionPoolLoadMetricSource"
class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource"
mode="On Demand">
+ <constructor>
+ <parameter>
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <value><inject
bean="ConnectionPoolUsageMetric"/></value>
+ </collection>
+ </parameter>
+ <parameter class="javax.management.MBeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
+ </constructor>
+ </bean>
+ <!-- Returns the connection pool usage as a ratio of used to max pool size -->
+ <bean name="ConnectionPoolUsageMetric"
class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ConnectionPoolUsageLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--constructor>
+ <parameter>InUseConnectionCount</parameter>
+ <parameter>MaxSize</parameter>
+ </constructor-->
+ </bean>
+ <!-- Generic load metrics/sources -->
+
+ <!-- Queries for mbeans matching the specified pattern -->
+ <bean name="MBeanQueryLoadMetricSource"
class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource"
mode="On Demand">
+ <constructor>
+ <parameter>
+ <collection
elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <value><bean
inject="MBeanAttributeLoadMetric"/></value>
+ <value><bean
inject="MBeanAttributeRatioLoadMetric"/></value>
+ </collection>
+ </parameter>
+ <parameter><!-- ObjectName pattern --></parameter>
+ <parameter><inject bean="JMXKernel"
property="mbeanServer"/></parameter>
+ </constructor>
+ </bean>
+ <!-- Uses the sum of the values of the specified attribute for each
+ mbean matching the query, with respect to a defined capacity. -->
+ <bean name="MBeanAttributeLoadMetric"
class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=MBeanAttributeLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter><!-- mbean attribute --></parameter>
+ </constructor>
+ <property name="capacity">1</property>
+ </bean>
+ <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
+ to the sum of the values of the specified divisor attribute for each mbean
+ matching the query. -->
+ <bean name="MBeanAttributeRatioLoadMetric"
class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric"
mode="On Demand">
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=MBeanAttributeLoadMetric",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter><!-- dividend attribute --></parameter>
+ <parameter><!-- divisor attribute --></parameter>
+ </constructor>
+ </bean>
+
</deployment>
\ No newline at end of file