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

tokio(metrics): fix blocking_threads count #6551

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

conradludgate
Copy link
Contributor

Motivation

Fixes #6550

Solution

For the multithreaded scheduler handles, subtract the number of worker threads from the blocking threads count.

@github-actions github-actions bot added R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR labels May 10, 2024
@mox692 mox692 added the M-metrics Module: tokio/runtime/metrics label May 11, 2024
@Darksonn Darksonn added the A-tokio Area: The main tokio crate label May 11, 2024
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Co-authored-by: Alice Ryhl <[email protected]>
@@ -8,7 +8,8 @@ impl Handle {
}

pub(crate) fn num_blocking_threads(&self) -> usize {
self.blocking_spawner.num_threads()
// workers are currently spawned within the blocking_spawned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// workers are currently spawned within the blocking_spawned
// workers are currently spawned using spawn_blocking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-metrics Module: tokio/runtime/metrics R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtime metrics blocking threads miscount
3 participants