A couple of notes.
> // Interceptor implementation ------------------------------------
> public Object invokeHome(MethodInvocation mi) throws Exception {
>
> try {
> sendMessage(System.currentTimeMillis(), createMessage(mi,
"START"));
> return super.invokeHome(mi);
> }
> finally {
> sendMessage(System.currentTimeMillis(), createMessage(mi,
"STOP"));
> }
> }
Using currentTimeMillis() extensively has its drawbacks. First of all it is
not very accurate, and can "skip" milliseconds so that two consecutive calls
can give 10 ms differences. Second, I think it is quite expensive, which is
why the logging API has a separate thread that calles cTM every few seconds
instead.
It might be the case that the above is too intrusive on the performance to
be useful. It will be more useful if the call being checked takes a long
time. For short calls it is not a good idea I think.
/Rickard