console icon indicating copy to clipboard operation
console copied to clipboard

subscriber: record a histogram of wake-to-poll times

Open seanmonstar opened this issue 4 years ago • 3 comments

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.

seanmonstar avatar Jun 15 '21 17:06 seanmonstar

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?

sieut avatar Sep 10 '21 07:09 sieut

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.

hawkw avatar Sep 10 '21 16:09 hawkw

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.

sieut avatar Sep 11 '21 04:09 sieut

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.

hds avatar Feb 14 '24 14:02 hds