Skip to content
/ fastatsd Public

Python client for the statsd daemon. Can be used as a drop-in replacement for the usual statsd module.

License

Notifications You must be signed in to change notification settings

qntln/fastatsd

Repository files navigation

Fastatsd

This is a Python client for the statsd daemon, which can be used as a drop-in replacement for the statsd module.

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

Features

  • cystatsd is used to encode metrics.
  • Metrics are sent over the network in a worker thread to avoid blocking the main thread.

Example

>>> import fastatsd
>>> c = fastatsd.Fastatsd('localhost', 8125)
>>> c.incr('foo')  # Increment the 'foo' counter.
>>> c.timing('stats.timed', 320)  # Record a 320ms 'stats.timed'.

The client also supports the context manager interface. This ensures that the worker thread sends all metrics on exit:

>>> import fastatsd
>>> with fastatsd.Fastatsd('localhost', 8125) as c:
>>>     c.incr('foo')

Installation

$ pip install cython
$ pip install -e git+https://github.com/qntln/cystatsd.git#egg=ql-cystatsd
$ pip install -e git+https://github.com/qntln/fastatsd.git#egg=fastatsd

About

Python client for the statsd daemon. Can be used as a drop-in replacement for the usual statsd module.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages