karouani / javasimon

Automatically exported from code.google.com/p/javasimon
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Double counting with Spring AOP #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is a similar to issue #97, but I'm not using @Monitored. Using the 
XML-config style of Spring AOP and adding the 
org.javasimon.spring.BasicMonitoringInterceptor, you get doubled counts for 
classes that are already subject to an AOP interceptor (e.g. @Transactional 
transaction processing).

I was able to work around it by overriding isMonitored in 
SpringStopwatchSource: 

            @Override
            public boolean isMonitored(final org.aopalliance.intercept.MethodInvocation methodInvocation) {
                return !ClassUtils.isCglibProxy(methodInvocation.getThis());
            };

but unfortunately, this means the cache method doesn't work any more, because 
it's keyed by method, which is the same for each aspect invocation (it's only 
the invocation target that allows you to distinguish them).

So the workaround is OK, but is there a way to rework the caching?

Original issue reported on code.google.com by art.ocat...@ipl.com on 1 Nov 2013 at 11:32

GoogleCodeExporter commented 8 years ago

Original comment by virgo47 on 3 Nov 2013 at 8:50

GoogleCodeExporter commented 8 years ago
I tried to reproduce the bug by using transactional processing and 
BasicMonitoringInterceptor, but I was not able to reproduce the bug.
Could you please share sample Spring configuration and code to help to 
reproduce the issue?

Original comment by ivan.mus...@gmail.com on 26 Feb 2014 at 9:01

GoogleCodeExporter commented 8 years ago
We cannot duplicate it without some demo. We can't fix it.

Original comment by virgo47 on 10 Mar 2014 at 10:01