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

metrics: Stabilize active_task_count #6619

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

Conversation

rcoh
Copy link
Contributor

@rcoh rcoh commented Jun 6, 2024

Motivation

Stabilize num_active_tasks so it can be used outside of --cfg tokio_unstable

Solution

  1. stabilize num_active_tasks
  2. Rename internal fields to match num_active_tasks
  3. Split rt_metrics into rt_metrics and rt_unstable_metrics.

Refs: #6546

@github-actions github-actions bot added R-loom-current-thread Run loom current-thread tests on this PR 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 Jun 6, 2024
@mox692 mox692 added A-tokio Area: The main tokio crate M-metrics Module: tokio/runtime/metrics labels Jun 7, 2024
tokio/tests/rt_metrics.rs Outdated Show resolved Hide resolved
@mox692
Copy link
Member

mox692 commented Jun 10, 2024

Since #6114 has been merged, we need to resolve conflict here.
Also, perhaps we should stabilize num_active_tasks instead of active_tasks_count?

@rcoh rcoh force-pushed the stabilize-active-tasks branch 3 times, most recently from 3542c59 to 0d087ef Compare June 14, 2024 16:09
Copy link
Member

@mox692 mox692 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

///
/// This value increases and decreases over time as tasks are spawned and as they are completed or cancelled.
///
/// To see the total number of spawned tasks, see `spawned_tasks_count`. Note that this API currently requires using `--cfg tokio_unstable`.
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is being stabilized, then the documentation should no longer say that it's unstable.

@rcoh
Copy link
Contributor Author

rcoh commented Jun 15, 2024 via email

@Darksonn
Copy link
Contributor

Okay. It's a bit confusing like this. You don't need to say that it's unstable in the docs for other methods.

rcoh added 2 commits June 18, 2024 17:06
1. stabilize `num_active_tasks`
2. Rename internal counters to match `num_active_tasks`
3. Split `rt_metrics` into `rt_metrics` and `rt_unstable_metrics`.
@Darksonn
Copy link
Contributor

I'm sorry for responding slowly here.

I'm wondering whether the name should be something else. The word "active" is the opposite of "idle", but the count includes idle tasks that have not yet exited. How about a name like alive_tasks_count?

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-current-thread Run loom current-thread tests on this PR 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.

None yet

3 participants