New submission from Andrew Svetlov <andrew.svet...@gmail.com>:

I suggest adding a `Task.stats()` method.
The method should return a dict with the task usage statistics.
Dict keys:
- total_time: a time between task creation and a moment of the call (or task 
finishing timestamp if the task has finished). The value includes a time for 
`await func()` waiting.
- real_time: a cumulative time for `Task._step()` executions
- switch_count: a count of `Task._step()` calls.

It can help with tasks activity analyzing.

Yuri, what do you think about?

----------
components: asyncio
messages: 314905
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Add stats for asyncio task usage.
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33221>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to