NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Profiling Maven + Cobertura

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Fabrizio Giudici
Posted via mailing list.





PostPosted: Tue Aug 04, 2009 5:42 pm    Post subject: Profiling Maven + Cobertura Reply with quote

Hello.

I have an interesting problem. In my project, using Maven and Cobertura,
some tests gets slowed down by a factor of 200x because of the presence
of Cobertura. This makes sense, as the relevant code is number crunching
code, for which instrumentation has an impact. I've excluded from
Cobertura instrumentation a few classes that were clearly responsible
for the problem, and now the slow down is 25x. Much better, but maybe
can be improved - but at this point I don't know where to look for, that
is which other class(es) should be excluded from instrumentation.

The best solution IMO would be to profile the test *with* instrumented
code. I've looked at the console and this is what NetBeans runs when
invoking the "Profile test" menu:


mvn -Dmaven.surefire.debug=-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/Users/fritz/Business/Tidalwave/Projects/jrawio/src/jrawio/nbproject/private/profiler
'-agentpath:/Applications/NetBeans/NetBeans
6.7.1.app/Contents/Resources/NetBeans/profiler3/lib/deployed/jdk16/mac/libprofilerinterface.jnilib=/Applications/NetBeans/NetBeans
6.7.1.app/Contents/Resources/NetBeans/profiler3/lib,5140,10' -classpath
%classpath -Dprofiler.action=profile-tests -DforkMode=once
-Dtest=CR2ImageReaderTest -Dnetbeans.execution=true -Pfritz test-compile
surefire:test

Reworking with a few required quotes I get:

mvn -Dmaven.surefire.debug="-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/Users/fritz/Business/Tidalwave/Projects/jrawio/src/jrawio/nbproject/private/profiler
'-agentpath:/Applications/NetBeans/NetBeans
6.7.1.app/Contents/Resources/NetBeans/profiler3/lib/deployed/jdk16/mac/libprofilerinterface.jnilib=/Applications/NetBeans/NetBeans
6.7.1.app/Contents/Resources/NetBeans/profiler3/lib,5140,10' "
-Dprofiler.action=profile-tests -DforkMode=once
-Dtest=CR2ImageReaderTest -Dnetbeans.execution=true -Pfritz test-compile
surefire:test

and I'm just ignoring the %classpath stuff for now. It seems to work: I
run maven, the applications pauses waiting for the profiler connection,
then I launch the profiler from NetBeans in "attach mode" etc...

I replaced surefire:test with cobertura:cobertura, and it seems I'm
actually profiling the thing with cobertura, since I see Cobertura
classes in the graphs.

So, two questions:

1. what is that %classpath about? Why does it seem that I can ignore it?
2. would it be possible to make this thing working from inside NetBeans,
reconfiguring a project Action? Because I don't see the configuration
related to testing a single test file.

Thanks.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
address-removed - mobile: +39 348.150.6941
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo