async_stats¶
An async transport method for statsd communication.
- class AsyncStatsClient(loop, host='localhost', port=8125, prefix=None)[source]¶
Bases:
StatsClientBase
An async implementation of
statsd.client.base.StatsClientBase
that supports async stat communication.- __init__(loop, host='localhost', port=8125, prefix=None)[source]¶
Create a new
AsyncStatsClient
.- Parameters:
loop (asyncio.AbstractEventLoop) – The event loop to use when creating the
asyncio.loop.create_datagram_endpoint
.host (
str
) – The host to connect to.port (
int
) – The port to connect to.prefix (
str
) – The prefix to use for all stats.
- async create_socket()[source]¶
Use
asyncio.loop.create_datagram_endpoint
from the loop given on init to create a socket.- Return type: