#Measuring time between awaits quickly

13 messages · Page 1 of 1 (latest)

spiral badge
#

From a https://ryhl.io article:

To give a sense of scale of how much time is too much, a good rule of thumb is no more than 10 to 100 microseconds between each .await.
Is there a quick way to check if my async functions comply with this requirement without adding time-measuring stuff into every function? Should I even do it?

cunning tundra
spiral badge
cunning tundra
#

it draws fancy graphs and stuff as well, so you can just eyeball things when testing/debugging issues

steep epoch
#

Is there a quick way to check if my async functions comply with this requirement without adding time-measuring stuff into every function? Should I even do it?
on an aggregate level, you can do this with runtime metrics

https://docs.rs/tokio/latest/tokio/runtime/struct.RuntimeMetrics.html

Additionally, if you are using async-profiler, my colleague has been working on a tool called pollcatch that might have more fidelity than tokio-console

Granted right now it does require manually instrumenting each tokio task, see example

I believe he ultimately hopes to get this into tokio as a simpler hook, which would remove the specific task instrumentation requirement

rose pendant
#

@steep epoch I'm curious about how async-profiler is used with Rust. What information can you get out of it? I found a little bit of info in the repo, but I'm wondering if anything "async" is included there?

I've have no experience with async-profiler, so maybe these questions don't make sense. My understanding is that it is primarily a tool to profile Java/JVM code.

steep epoch
#

cc @mighty lintel re async-profiler

supple bolt
steep epoch
#

Might be nice to contribute a small 'using it with rust' guide to the async-profiler repo similar to that C one if you have the cycles @supple bolt?

#

In the interim @rose pendant there is a usage guide in the pollcatch readme that includes async-profiler setup

rose pendant
#

What’s the difference between using async-profiler and perf or dtrace? Or is it really just an alternative to those when it comes to native code?

supple bolt