3 Replies Latest reply on Feb 17, 2010 3:10 PM by pferraro

    Exposing load metrics via JMX




      I'm trying to get load metrics values via JMX. I cannot see getLoad() method to be exposed in a load metric bean.


      How can I obtain load let's say for BusyConnectorsLoadMetric via JMX?



        • 1. Re: Exposing load metrics via JMX

          At the moment, you cannot fetch individual load values via JMX.  The getLoad(...) method on LoadMetric requires a LoadContext.  Consequently, this is not usable as a mbean method.  With some work, however, you can achieve what you're looking for.


          First, extend the LoadMetricMBean interface with the following:


          {code}public interface MyLoadMetricMBean extends LoadMetricMBean


            double getLoad();



          Next, extend the BusyConnectorsLoadMetric impl, and implement getLoad().

          We'll express this metric's load in terms of its capacity:


          {code}public class MyBusyConnectorsLoadMetric extends BusyConnectorsLoadMetric implements MyLoadMetricMBean


            public MyBusyConnectorsLoadMetric() throws MalformedObjectNameException   {     super();   }


            public double getLoad()


              MBeanQueryLoadContext context = this.getSource().createContext();



                return this.getLoad(context) / this.getCapacity();









          Now use the new load metric impl and mbean interface in your *-jboss-beans.xml config:


          {code:xml}<bean name="BusyConnectorsLoadMetric" class="org.jboss.modcluster.load.metric.impl.MyBusyConnectorsLoadMetric" mode="On Demand">




          On second thought, this seems like a useful method to expose via JMX.  I'll create a feature request.

          • 2. Re: Exposing load metrics via JMX

            That looks like a really nice idea to bake in. Does any one know how JOPR manages to dig this out:


            For example: http://www.jopr.org/display/JOPR2/Web+Application+(WAR)+Service#WebApplication%28WAR%29Service-Metrics

            (just want to make sure there isn't an existing path for this data that we are missing).

            • 3. Re: Exposing load metrics via JMX

              It looks like Jopr uses the same JMX-based mechanism as mod_cluster to detect connector thread busyness:



              BTW - I've created a feature request for this topic: