7 Replies Latest reply on Oct 7, 2002 12:29 PM by vorlon

    Pool statistics and MC4J

    vorlon

      Hello,

      I just tried the MC4J JMX Management Console. So I was wondering if there is way to graph statistics of JBoss pool sizes and activity statistics (especially for CMP 1.1 entity beans). I did not find anything so far in the JMX tree of my running JBoss 3.0.2 instance.

      Is there a way to turn on this kind of statistics attributes?

      Thanks in advance,
      Michael

        • 1. Re: Pool statistics and MC4J

          By default MC4J is able to monitor only attributes exposed in the mbean's interfaces... sooo, the only graph statistics you can get are the of the attributes you can see with the jmx-console.

          In general, it's up to each individual developer what they expose in terms of management attributes.

          • 2. Re: Pool statistics and MC4J
            cepage

            The MBeans for Entity Bean containers contain a getCacheSize method that returns an integer. This would be ideal for plotting in MC4J, except that this method is exposed as an operation rather than attribute.

            Any reason we shouldn't patch this MBean to use CacheSize as an attribute?

            Corby

            • 3. Re: Pool statistics and MC4J

              I see no reason why not but I'm not responsible of that piece of code. Which MBean is this, a JSR-77 one?

              -- Juha

              • 4. Re: Pool statistics and MC4J
                cepage

                I don't believe this is JSR-77. The declaration is:

                public class EntityContainer
                extends Container
                implements ContainerInvokerContainer, InstancePoolContainer, StatisticsProvider

                I don't see any references to J2EEManagedObject.

                The relevant code is where it creates the MBeanInfo:

                opInfo[superOpInfoCount] =
                new MBeanOperationInfo(
                "getCacheSize",
                "Get the Container cache size.",
                noParams,
                "java.lang.Integer",
                MBeanOperationInfo.INFO);
                (Later, a handler exists in invoke(...) to process the method.)

                So I believe I just have to replace this code to create an MBeanAttributeInfo, and create an implementation of getAttribute(...) to handle it, and we are good to go, yes?

                Corby

                • 5. Re: Pool statistics and MC4J

                  yep

                  • 6. Re: Pool statistics and MC4J
                    cepage

                    Patch submitted to Sourceforge.

                    • 7. Re: Pool statistics and MC4J
                      vorlon

                      Thanks! This was very quick. I am impressed :-) I will try to apply the patch...