-
Notifications
You must be signed in to change notification settings - Fork 979
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
Expose ForkJoinPool parallelism and pool size metrics #5236
Conversation
I think no one asked for it so far. What is your use-case behind parallelism? Are you setting it explicitly? By default, it uses the value of I think based on the use-case, the pool size can also be useful since its value will be the same as parallelism if enough tasks are submitted but if not, it can be lower, please feel free to add a I also wanted to ask you to write some tests but then I realized there are no tests for /cc @shakuzen |
Well, I don't do it now, but I might in future as in container environment JVM's heuristics don't always work correct. Anyway, it's possible to create a new
I added a simple one. Please tell me if you need more. |
02a203f
to
1ee9a99
Compare
The failed test is this one:
Doesn't look like a related failure, does it? |
Yepp, that might be a valid scenario, though in that case upgrading Java might be a simpler task than modifying every place you use a pool. I think there could also be a valid (but very rare) use-case even if ergonomics sets the cpu size and the pool sizes correctly. In containerized environments, you can modify cgroup limits while the process is running. This can mean that the cpu count can increase or decrease over time and your pools might not. I haven't tried if
Thank you! I also forgot to say thank you for opening the PR in the first place so double thank you! :)
No, that test is flaky which we should fix, I re-triggered the failed job and now it's green. |
...eter-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
Outdated
Show resolved
Hide resolved
...eter-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
Show resolved
Hide resolved
...eter-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
Outdated
Show resolved
Hide resolved
...eter-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
Outdated
Show resolved
Hide resolved
Thank you, folks! |
Thank you for the pull request and the quick action on reviews. |
Hello, contributors,
I recently switched to using virtual threads, so became a big user of ForkJoinPool. When I looked at metrics, exposed by micrometer, I saw that parallelism isn't exposed. Is there a reason for this? Well, if not, I believe this could be a nice addition to already exposed ones.
I hesitated to add ForkJoinPool::getPoolSize, as I'm not sure this one is important, but I could add it too. What do you think about it?