Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor.queued metrics of ForkJoinPool should include queued submissions #5650

Open
tommyk-gears opened this issue Nov 8, 2024 · 0 comments

Comments

@tommyk-gears
Copy link

Please describe the feature request.
A clear and concise description of what you would like to be able to do with Micrometer and cannot currently.
In io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics#monitor(io.micrometer.core.instrument.MeterRegistry, java.util.concurrent.ForkJoinPool) the executor.queued metrics is bound to ForkJoinPool::getQueuedTaskCount.

The javadoc for ForkJoinPool::getQueuedTaskCount states:

Returns an estimate of the total number of tasks currently held in queues by worker threads (but not including tasks submitted to the pool that have not begun executing). [...]

Now, in ForkJoinPool there is aslo getQueuedSubmissionCount() with this javadoc;

Returns an estimate of the number of tasks submitted to this pool that have not yet begun executing. [...]

The current bindings completely ignores the getQueuedSubmissionCount(). One solution might be to just bind executor.queued to the sum of getQueuedTaskCount() and getQueuedSubmissionCount(). Another solution might be to have them both bound to executor.queued but with different additional tags (but that might be considered a breaking change, and align badly with metrics on other types of ExecutorServices?).

Rationale
In my opinion it is more interesting to monitor the queued submissions than the queued tasks (in ForkJoinPool terminology) since when the pool threads are not able to keep up with the submission, they will pile up in queued submissions (but the number of queued tasks remain at 0 in my experience).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant