1) Deploy the etat.ear
2) Start up the EAP server
3) Setup some vars for use by twiddle commands:
serverUrl='jnp://localhost:1099'
jmxUser='admin'
jmxPassword='admin'
mBeanName='jboss.j2ee:jndiName=TestBean,service=EJB'
mBeanAttr='DetypedInvocationStatistics'
mBeanOperation='resetInvocationStats'
4) Run twiddle to make sure it is working and given a base-line:
./twiddle.sh -s "${serverUrl}" -u "${jmxUser}" -p "${jmxPassword}" get "${mBeanName}" "${mBeanAttr}"
Should see something similar to:
DetypedInvocationStatistics={#Global={lastResetTime=1304634714452, concurrentCalls=0, maxConcurrentCalls=0}}
5) Now invoke the EJB using the servlet:
wget "http://localhost:8080/etatWeb/TestEJBServlet" -a etat.log
6) Run twiddle again to see that it actually invoked the EJB and we have valid stats:
./twiddle.sh -s "${serverUrl}" -u "${jmxUser}" -p "${jmxPassword}" get "${mBeanName}" "${mBeanAttr}"
Should look something like:
DetypedInvocationStatistics={remove=
{minTime=1, maxTime=1, count=1, totalTime=1}
, create=
{minTime=121, maxTime=121, count=1, totalTime=121}
, sayHello=
{minTime=3, maxTime=3, count=1, totalTime=3}
, #Global={lastResetTime=1304635345747, concurrentCalls=0, maxConcurrentCalls=1}}
7) And here is how we make things go bad, invoke the resetInvocationStats operation on the EJB using twiddle:
./twiddle.sh -s "${serverUrl}" -u "${jmxUser}" -p "${jmxPassword}" invoke "${mBeanName}" "${mBeanOperation}"
8) The resetInvocationStats operation will be successful but look what happens when we get the stats now:
./twiddle.sh -s "${serverUrl}" -u "${jmxUser}" -p "${jmxPassword}" get "${mBeanName}" "${mBeanAttr}"
You should get some wacky results similar to:
DetypedInvocationStatistics={remove=
{minTime=9223372036854775807, maxTime=0, count=0, totalTime=0}, create={minTime=9223372036854775807, maxTime=0, count=0, totalTime=0}
, sayHello=
{minTime=9223372036854775807, maxTime=0, count=0, totalTime=0}
, #Global={lastResetTime=1304635363064, concurrentCalls=0, maxConcurrentCalls=0}}
So, looking at what we get, it is the minTime that is wrong. we should expect it to be 0. This is probably happening because after a reset we should probably expected the stats to look like:
DetypedInvocationStatistics={#Global=
{lastResetTime=1304634714452, concurrentCalls=0, maxConcurrentCalls=0}
}