Has anybody tried to add custom performance counters to JavaMelody? I mean like "I'd like to see the time taken by this part 开发者_StackOverflow社区of code" (sort of like a profiler would do) and put that on to the monitoring dashboard. Is it even possible with JavaMelody 1.31 ?
There is a feature request for adding custom counters to JavaMelody: https://code.google.com/p/javamelody/issues/detail?id=251
There is no profiler or sampler yet, from what I know. But there is now an issue 149 about something close to that and a contribution in it.
And you can already add statistics in javamelody including mean execution time on some EJB, Spring Beans, Guice or java interfaces (see user guide).
Otherwise, there are other tools, such as samplers and profilers in JVisualVM of the Oracle/Sun JDK for larger sampling / profiling.
精彩评论