Add meter for ForkJoinPool#getDelayedTaskCount
This new public method was added in Java 25. See https://github.com/openjdk/jdk/pull/23702/files#diff-e398beb49cd8d3e6c2f3a8ca8eee97172c57d7f88f3ccd8a3c704632cab32f5fR3924-R3936.
Returns an estimate of the number of delayed (including periodic) tasks scheduled in this pool that are not yet ready to submit for execution. The returned value is inaccurate while delayed tasks are being processed.
We already monitor getQueuedTaskCount, but as now noted:
The returned count does not include scheduled tasks that are not yet ready to execute, which are reported separately by method
getDelayedTaskCount.
The corresponding documentation should be updated.
We'd want to run a test for this with a Java 25 JVM, which isn't available for the CircleCI convenience image we currently use (cimg/openjdk). We could rely on the Gradle auto-provisioning feature to download a JRE to run the test task that requires Java 25, but it'd be ideal to not need to download a runtime during the build.
@shakuzen Would love to raise a draft PR as my first contribution to the project. Can you pls confirm if I can go ahead? Post the image is released we can run tests for validation
Hi @Indresh2410,
Thank you for offering your help. We always welcome contributions. In this case, this is a bit more challenging since that method does not exist in every JRE so the implementation and the testing is not as straightforward but in the jvm package you should see how similar conditions are handled (for tests see @EnabledForJreRange).
If you are up to that headache :) and don't mind that this is a bit harder to make your first contribution, please feel free to open a PR, but please make sure the build can run with Java 24 and 25 (early access builds are available) too.
Java 25 should be released in mid September and since we already using a non-CircleCI image for Java 24, maybe we could do the same for Java 25 too (we can add those bits before merging your PR in).