Asyncio debug log _run_once duration?

asyncio debug mode logs individual coroutine durations if they block for longer than a threshold. Would it be reasonable to also apply this same log measurement and condition to the duration of _run_once?

This will capture e.g. when one eventloop iteration is slow, not just because one coroutine is blocking, but because there might be many smaller tasks to process (e.g. 10 10ms operations in one tick blocks incoming operations as much as one 100ms task, but nothing is logged, currently). It might be less actionable info if it doesn’t log the tasks, but it’s proved useful to us in the past with other event loops (pre-asyncio tornado).

1 Like

If you feel like creating a PR for that, go ahead (but it would need an issue as well to track the discussion).