Pre-release
This release is a pre-release and may not be stable for production use.
asyncstatsd
Installation
$ pip install asyncstatsd
Usage
Pure statsd
from asyncstatsd.client import StatsdClient
def foo(statsd):
statsd.incr('some.counter')
statsd.timing('some.timer', 320)
async def bar(statsd):
statsd.incr('some.counter')
statsd.timing('some.timer', 320)
with statsd.timer('some.timer'):
await asyncio.sleep(1)
async def main():
client = StatsdClient('localhost', 8125)
await client.connect()
foo(client)
await bar(client)
Statsd extended with Datadog tags
from asyncstatsd.client import DatadogClient
def foo(statsd):
statsd.incr('some.counter', tags=dict(tag1='value1', tag2='value2'))
statsd.timing('some.timer', 320, tags=dict(tag1='value1', tag2='value2'))
async def bar(statsd):
statsd.incr('some.counter', tags=dict(tag1='value1', tag2='value2'))
statsd.timing('some.timer', 320, tags=dict(tag1='value1', tag2='value2')
with statsd.timer('some.timer', tags=dict(tag1='value1', tag2='value2'):
await asyncio.sleep(1)
async def main():
client = DatadogClient('localhost', 8125)
await client.connect()
foo(client)
await bar(client)
Metadata
Release files for asyncstatsd 1.0.0a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asyncstatsd-1.0.0a0.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asyncstatsd-1.0.0a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / asyncstatsd-1.0.0a0.tar.gz
| Download URL | asyncstatsd-1.0.0a0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1071d9dd0ca1fd651335633cd91e51abd2110c0ca0aeb4c3831a311f0503af32
|
|
BLAKE2b-256 checksum How to use checksums |
9ba7f9ece4760190df6d3004c0ab47f06ae44e8ea438c8a7cea8749ca13a2673
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.1 Linux/6.6.13-amd64
|
Release files / asyncstatsd-1.0.0a0-py3-none-any.whl
| Download URL | asyncstatsd-1.0.0a0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e34f8d056c4f0146d17e58624992d88127d7d7f23a0550cba013af06c2a60f12
|
|
BLAKE2b-256 checksum How to use checksums |
0026f54e54b6327de070f2de935df13501c8ecc0eb51917192f8c67dd980472b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.1 Linux/6.6.13-amd64
|