perf-timer icon indicating copy to clipboard operation
perf-timer copied to clipboard

trio async timings should include child tasks

Open belm0 opened this issue 3 years ago • 0 comments

For perf-timer async support (Trio), I implemented the smallest possible thing: within a task, measure time excluding periods where the task is de-scheduled (sleeping, blocked on i/o or an event, etc.)

However, there is a strong use case for including the time spent in descendant tasks of the instrumented task (spawned by a nursery). This aggregate time would directly correlate to CPU usage. For example, if you measured the duration of async function foo() including child tasks as 5 s, while the total application runtime was 100 s, that means foo() was responsible for 5% of the CPU use.

belm0 avatar Jul 19 '22 05:07 belm0