Java 8 ForkJoinPool Monitor

Is there a way to control what Java ForkJoinPool does over time, in particular how effeciently CountedCompleter does?

  • How long did it take to complete the subtasks?
  • Was one of the subtasks longer than the rest?
  • Did they perform in parallel?

For the example triggers in the CountedCompleter javadoc, the monitoring tool will tell me that completion PacketSenderwas limited HeaderBuilder, which started over, but took 13 seconds, and BodyBuildertook 4 seconds and ended earlier.

I am looking for such a tool, mainly as a Java agent, so as not to pollute my production code with unnecessary statistics, but I did not find anything.

Thanks for any help

+4
source share
1 answer

The best (and only realistic) way is to use AOP to "spy" on calls to methods and the start and end dates of recordings and contexts that can be collected for statistical analysis.

I used AspectJ for a good effect and can recommend it, but any such library should work.

0
source

Source: https://habr.com/ru/post/1679414/


All Articles