Metadata-Version: 2.1
Name: asyncstatsd
Version: 1.0.0a0
Summary: 
Author: Lukasz Jachym
Author-email: lukasz.jachym@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown

# asyncstatsd

## Installation

    $ pip install asyncstatsd

## Usage

### Pure statsd

```python
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

```python
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)
```

