This content has been marked as final.
Show 1 reply
-
1. Re: how can i make all method in a jar be traced and get its method name and execute time
adinn Jan 15, 2016 5:16 AM (in response to rjl493456442)Hi,
If you want to trace all methods in a jar then I recommend you find a different tool. Byteman is normally used to transform single methods or small groups of methods. Bulk method transformations are better done using a general purpose Aspect Oriented Programming tool (for example you might look at AspectJ).
It is possible to use Byteman do what you want. You would have to write a standalone program to read each class in your jar, use reflection to identify the methods of the class and then generate a Byteman rule to track entry and exit times for each method, dumping the method name and elapsed time at exit. If you are not familiar with Java then I don't think you will find it easy to write this program.
regards,
Andrew Dinn