asyncio_inspector
Crazily simple statistics tracker for asyncio event loops, for the moments when just setting the event loop to debug mode is not enough.
This package is meant to be used to track basic statistics about asyncio event loops, so you can easily see which methods are blocking the event loop for longer, preventing other tasks from running.
Install it from PyPI
pip install asyncio_inspector
Usage
Enable inspection on any given event loop with the inspect(event_loop) and uninspect(event_loop) methods:
from asyncio_inspector import inspect, uninspect
loop = asyncio.get_event_loop()
stats_tracker = inspect(loop)
loop.call_soon(my_async_function)
loop.call_soon(another_async_function)
loop.call_soon(loop.stop)
uninspect(loop)
Or with a context manager:
loop = asyncio.get_event_loop()
with enable_inpection(loop) as stats_tracker:
await my_async_function()
await another_async_function()
Then, you will have some statistics in the stats_tracker object:
stats_tracker.call_counts == {
"my_async_function": 1,
"another_async_function": 1
}
# Times are in nanosecs
stats_tracker.total_time == {
"my_async_function": 123,
"another_async_function": 333
}
stats_tracker.max_time == {
"my_async_function": 400,
"another_async_function": 500
}
stats_tracker.min_time == {
"my_async_function": 100,
"another_async_function": 200
}
Development
Read the CONTRIBUTING.md file.
Metadata
Release files for asyncio-inspector 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asyncio_inspector-0.1.0.tar.gz | 6.5 kB | Without provenance | Details for asyncio_inspector-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncio_inspector-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for asyncio_inspector-0.1.0-py3-none-any.whl |
Total release size: 13.0 kB
Release files / asyncio_inspector-0.1.0.tar.gz
| Download URL | asyncio_inspector-0.1.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2aa1120ba883326b8920ba50295a374d5da308b68671c58c8d4e9f665488cfa
|
|
BLAKE2b-256 checksum How to use checksums |
fc37e8f3a380b55b41fea4b109410b6e05754e1174fadd41809c373e97a919a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / asyncio_inspector-0.1.0-py3-none-any.whl
| Download URL | asyncio_inspector-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93130307422cf1fe97a68f50940c3682f2047b02dfa1de72371eddfb2a14de1b
|
|
BLAKE2b-256 checksum How to use checksums |
10985db0345fee3ce69ec749c7067efbc562e0306a83d158be420d2ecd3ac01a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for asyncio-inspector 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.