You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ cargo tree | grep tokio
├── tokio v1.29.0
│ ├── tokio-macros v2.1.0 (proc-macro)
└── tokio-metrics v0.1.0
└── tokio v1.29.0 (*)
Platform
x86_64 Linux
Description
I am using RuntimeMetrics::worker_total_busy_duration to calculate the estimated event load on the tokio runtime (basically the same calculation as busy_ratio in the tokio-metrics crate). Recently, I noticed that there was a change in the reported event load numbers after upgrading tokio, and I was able to narrow it down to #5720 which happened between versions 1.28 and 1.29. Here is a simple example to demonstrate what I am seeing:
As far as I am aware, this program should be idle for a majority of the time, so the event load should be low. However running the program gives the following numbers:
I am not too sure why, but for some reason the loop with the tokio::time::sleep call is causing this weird output. This only happens when using a multi-threaded runtime in tokio versions 1.29 and greater. If I use #[tokio::main(flavor = "current_thread")] or tokio 1.28, there is no issue:
Version
Platform
x86_64 Linux
Description
I am using
RuntimeMetrics::worker_total_busy_duration
to calculate the estimated event load on the tokio runtime (basically the same calculation asbusy_ratio
in thetokio-metrics
crate). Recently, I noticed that there was a change in the reported event load numbers after upgrading tokio, and I was able to narrow it down to #5720 which happened between versions 1.28 and 1.29. Here is a simple example to demonstrate what I am seeing:As far as I am aware, this program should be idle for a majority of the time, so the event load should be low. However running the program gives the following numbers:
I am not too sure why, but for some reason the loop with the
tokio::time::sleep
call is causing this weird output. This only happens when using a multi-threaded runtime in tokio versions 1.29 and greater. If I use#[tokio::main(flavor = "current_thread")]
or tokio 1.28, there is no issue:The text was updated successfully, but these errors were encountered: