Evaluating one thread performance across all the methods
There is one thread which executes say 50 methods across several packages. I want to evaluate execution time for each method. This thread wakes on a signal and process this 50 method.
Answer or discussion is encouraged but please read my notes:
- Please do not suggest to put System.nano/mills at 开发者_开发知识库the start and at the end of each method.
- No profiler suggestion please.
- Do not suggest to mess this application with performances evaluation lines.
- Appreciate if someone gives an example using BTrace or ThreadMXBean or anything new.
Like to evaluate programmatically, so appreciate if anyone has better ideas.
Perf4J might be an option. I've never used it myself. But from the website they support annotating methods in order to instrument them. Live stats can be observed via MXBean, aka. jconsole or after the run in log files.
精彩评论