Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

A tiny library for monitoring and testing asyncio programs

Project description

This is a tiny library for monitoring and testing asyncio programs. Its monitoring features are meant to be always on in production.

Aiodebug will use logwood if it is installed, otherwise it will default to the standard logging module.

Aiodebug is only tested with Python 3.5. There are no plans to support older versions.

Log warnings when callbacks block the event loop


This will produce WARNING-level logs such as

Executing <Task pending coro=<foo() running at /home/.../>
wait_for=<Future pending cb=[Task._wakeup()]>> took 0.069 seconds

Asyncio already does this in debug mode, but you probably don’t want to enable full-on debug mode in production.

Track event loop lags in StatsD


Tracks how much scheduled calls get delayed and sends the lags to StatsD:

Speed up or slow down time in the event loop

This is mainly useful for testing.

loop = aiodebug.testing.time_dilated_loop.TimeDilatedLoop()

loop.time_dilation = 3
await asyncio.sleep(1) # Takes 0.333s of real time

loop.time_dilation = 0.1
await asyncio.sleep(1) # Takes 10s of real time

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiodebug, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size aiodebug-1.1.2.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page