metrics: stabilize num_alive_tasks#6619
Conversation
|
Since #6114 has been merged, we need to resolve conflict here. |
3542c59 to
0d087ef
Compare
tokio/src/runtime/metrics/runtime.rs
Outdated
| /// | ||
| /// 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`. |
There was a problem hiding this comment.
If this is being stabilized, then the documentation should no longer say that it's unstable.
|
Ah that comment was attempting to refer to spawned_task_count
…On Sat, Jun 15, 2024, 3:06 PM Alice Ryhl ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tokio/src/runtime/metrics/runtime.rs
<#6619 (comment)>:
> @@ -47,6 +47,29 @@ impl RuntimeMetrics {
self.handle.inner.num_workers()
}
+ /// Returns the current number of active tasks in the runtime.
+ ///
+ /// 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`.
If this is being stabilized, then the documentation should no longer say
that it's unstable.
—
Reply to this email directly, view it on GitHub
<#6619 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYKZZO5E3NIQNX465VC7LZHSGEFAVCNFSM6AAAAABI5FHB4SVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMRQG44TGNZYHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Okay. It's a bit confusing like this. You don't need to say that it's unstable in the docs for other methods. |
0d087ef to
c2b7d9a
Compare
|
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 |
|
runnable? That has some issues too. I wonder if this would be helped with a
TaskMetrics struct that could give some docs to explain the different task
states & group the metrics.
…On Sun, Jun 30, 2024, 4:46 AM Alice Ryhl ***@***.***> wrote:
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?
—
Reply to this email directly, view it on GitHub
<#6619 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYKZ5ICVVOKM5II2OKRUTZJ7OXTAVCNFSM6AAAAABI5FHB4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGUYTKNJRGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
I ended up renaming it in #6667. |
|
I don't think runnable works either. That also implies that idle tasks shouldn't be counted, but they are. |
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`.
c2b7d9a to
0fd010f
Compare
0fd010f to
fa322a0
Compare
|
Sorry for the delay on this. @Darksonn I've rebased. I noticed there was a mix between |
|
That makes sense. The publicly used name is |
Motivation
Stabilize
num_active_tasksnum_alive_tasksso it can be used outside of--cfg tokio_unstableSolution
num_alive_tasksnum_alive_tasksrt_metricsintort_metricsandrt_unstable_metrics.Refs: #6546