console
console copied to clipboard
subscriber: record a histogram of wake-to-poll times
A way for someone to better understand how the runtime itself is behaving is to record a history of how long it takes a task to be polled after it was been woken. We could either record this information per task, or on a whole. I think as a whole is probably sufficient, and would mean less data needs to be sent per task (see https://github.com/tokio-rs/console/pull/47#discussion_r651976189). But if there's a very helpful use case for knowing this data per task, we could do that.
Hi @seanmonstar, I've been reading up on https://github.com/tokio-rs/console/pull/47 to see how to do this. Do you mind if I take a stab at this issue?
It's possible that this data is also collected by tokio's runtime metrics feature (https://github.com/tokio-rs/tokio/issues/4073), which I would like to start integrating into the console. It might be worth looking at the upstream API to see if that's the case.
Otherwise, we can definitely record this with the data we're already aggregating.
Thank you @hawkw for the note. I read the RFC and it doesn't look like there's something we can use for this issue specifically. It looks like that work is more concerned with collecting perf-counter type metrics than aggregating latency.
This task is done now per task. As we don't currently have any "as a whole" or "per runtime" histograms, I think that we can consider it complete after #406 was merged.
Any histograms per runtime would be added once runtimes themselves have been instrumented in Tokio.