JMX monitoring - openejb invocation metrics description

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JMX monitoring - openejb invocation metrics description

mithun6381
I am trying to monitor EJB's Apache Geronimo server using JMX with
openejb.management
(openejb.management:J2EEServer=openejb,J2EEApplication=null,EJBModule=mejb,StatelessSessionBean=ejb/mgmt/MEJB,j2eeType=Invocations,name=ejb/mgmt/MEJB).

Here, the following metrics are available : InvocationCount, InvocationTime
and MonitoredMethods. But the description of these are not available.

I searched the whole documentations. But could not find. Can anyone pls help
? InvocationCount is the no. of times the EJB is invoked. What are
InvocationTime and Monitoredmethods? (Both are integer values ).



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
Reply | Threaded
Open this post in threaded view
|

Re: JMX monitoring - openejb invocation metrics description

David Blevins-2
> On Sep 14, 2017, at 11:15 PM, mithun6381 <[hidden email]> wrote:
>
> I am trying to monitor EJB's Apache Geronimo server using JMX with
> openejb.management
> (openejb.management:J2EEServer=openejb,J2EEApplication=null,EJBModule=mejb,StatelessSessionBean=ejb/mgmt/MEJB,j2eeType=Invocations,name=ejb/mgmt/MEJB).
>
> Here, the following metrics are available : InvocationCount, InvocationTime
> and MonitoredMethods. But the description of these are not available.
>
> I searched the whole documentations. But could not find. Can anyone pls help
> ? InvocationCount is the no. of times the EJB is invoked. What are
> InvocationTime and Monitoredmethods? (Both are integer values ).

Hi Mithun,

Pull requests to the documentation are certainly welcome.  Here are the details:

== InvocationTime

Reflects the total time in nanoseconds that the the specified method has spent executing in all threads combined since the start of the server.  So this number will only ever go up.  The percentiles, particularly the 90, 95 and 99 percentiles are probably the best for writing tooling against.  This `InvocationTime` is simply another data point which may or may not be useful in the struggle to performance tune an app.  You'd probably check it after a performance run on a newly booted set of servers.  It gives you a flat simple number that directly tells you how much time all threads spent there.  If you made a Pie chart of the `InvocationTime` of all the beans you'd get a pretty great view of where on whole your system spends the most time.

People can fall into traps doing performance tuning only looking at average invocation time.  Say you improved a method's average time from 5ms to 4ms, but in the tuning process you made another change so that method is getting invoked 2 times as often.  It's a net loss, but only looking at seeing the average go from 5ms to 4ms you might be falsely lead to thing an improvement has been made.

Without InvocationTime if you wanted to know how long a method spent executing during the entire run, you'd have to do something like take the average and multiply it by the invocation count.  It would be close but not exact as the average is by default over 2000 samples.  If the invocation count was 100,000 you'd have to really just hope the other 98,000 invocations were very similar to the 2000 you're looking at.

Final note, InvocationTime is an AtomicLong in the code, so it should show up in JMX as a long.  If not there could be some bug there.  A long of nanoseconds in Java can hold about 585 years of time before it wraps around.  A signed 32bit int can only hold 6.4 years of combined execution time before it wraps.


== MonitoredMethods

This was simply for my benefit while writing the code.  It reports how many methods of the EJB are being monitored per your configuration and have also been invoked.  Debug information at best perhaps.


-David