This fully personal project has been made to ease the profiling of some java projects I was working on.
It mainly comes from a lot of informations and ideas I have had from internet. So to redistribute under LGPL it is the less thing I can do.
To use it :
from the java launch you have to add some arguments.
Arguments should be of the form <PortNumber>;package1;package2;package3...
For example : 12001:com.mycomp:org.mypackage.utils
Note that ':' is the argument separator for premain and agentmain values.
Complete syntax to add to the java launch :
-javaagent:<AbsolutePath of the profiler jar>=<port>;<package1>;<package2>...
Port is the port number where you will have to connect your client.
Package1, Package2 and so on are package that you want to profile.
Assuming you have an application with some specific packages like com.onecompany.oneapp
and that this package has 2 sub packages services and algo, you can profile every class of the app,
or only one of the 2 packages.
To profile all the classes :
To profile only the package services :
To profile the package algo and the two libs it uses :
You do not have to indicate the profiler jar into the class path of your java call since you already mention it into the javaagent argument.
Once this is done, you can launch the profiler UI client using the class org.xneb.profiler.ui.ProfilerClient
java -cp c:\JavaClassProfile\target\profiler.jar org.xneb.profiler.ui.ProfilerClient
Press Profiler and connect
then enter the name of your machine running your jvm to profile and the port you register in the javaagent argument.
Click on refresh to retrieve the last measures.
You're done !!!