-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
add feature to show mpsc channel metrics #278
Comments
Yea, this is definitely desired. It'd mostly require instrumentation in the Tokio crate, and then the console would just "see it". Would you be interested in helping add this? |
If @whitelilis doesn't call dibs I'd be willing to help with this. |
I believe @zaharidichev previously added instrumentation to the Tokio MPSC channels, but it had to be removed because the |
(the problem is specifically the |
Hi @hawkw, I've been playing with this locally and have a working prototype that records various stats about an (un)bounded mpsc channel: I've also run into the deadlock you describe when switching I'm happy to try and push this forwards but I'm not sure how best work around this - any pointers? Below is the metadata for the
|
@domodowyer
I'm working on an upstream change to fix this: tokio-rs/tracing#2020 If you have the time, it would be very helpful to try using a cargo patch to test the changes in that PR against your console branch, and make sure everything works. |
Hi @hawkw, I had a play around with the I have attached a full backtrace below, but it appears that while the
Thanks for your work on this - I'm happy to help however I can 👍 Backtrace
|
I've pushed my tokio instrumentation changes and pre-emptively opened a PR, using that branch gives us a simple reproducer: use std::time::Duration;
#[tokio::main(flavor = "current_thread")]
async fn main() {
console_subscriber::init();
tokio::spawn(async {
tokio::time::sleep(Duration::from_secs(100000)).await;
});
} and a patch in the [patch.crates-io]
tokio = { git = "https://github.com/domodwyer/tokio", branch = "dom/trace-mpsc" } The deadlock should be reproducible with a simple I hope this helps - I took a look at the code but I'm not familiar enough with the tracing internals to come up with a nice solution, but I'm happy to help however I can 👍 |
The resource now only show semaphore and timer, it is very helpful to show channel metrics, such as how many message in/out/drop/still_in_channel.
The text was updated successfully, but these errors were encountered: