A Python statsd client
A python client for Etsy's StatsD server and InfluxDB's Telegraf StatsD server.
Code: https://github.com/macobo/statshog
License: MIT; see LICENSE file
Issues: https://github.com/macobo/statshog/issues
Documentation: https://statshog.readthedocs.io/
Install
The easiest way to install statsd is with pip!
You can install from PyPI:
pip install statshog
Or GitHub:
$ pip install -e git+https://github.com/macobo/statshog#egg=statshog
Or from source:
git clone https://github.com/macobo/statshog
cd pystatsd
python setup.py install
Usage
Quick usage
import statshog
statsd = statshog.StatsClient(host='localhost', port=8125)
statsd.incr('foo') # Increment the 'foo' counter.
statsd.timing('stats.timed', 320) # Record a 320ms 'stats.timed'
Using with telegraf/influxdb
import statshog
statsd = statshog.StatsClient(telegraf=True)
statsd.timing('stats.timed', 320, tags={"mytag": 456})
Usage with django
Update your settings.py to have the following values if using non-defaults:
STATSD_HOST(default:'localhost')STATSD_PORT(default:8125)STATSD_PREFIX(default:None)STATSD_MAXUDPSIZE(default:512)STATSD_IPV6(default:False)STATSD_TELEGRAF(default:False)STATSD_SEPARATOR(default:'.')
Then, you can use statshog as following:
from statshog.defaults.django import statsd
statsd.timing('stats.timed', 320)
To use together with
django-statsd, also add
the following to your settings.py:
STATSD_CLIENT = "statshog"
Metadata
Release files for statshog 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| statshog-1.0.6.tar.gz | 26.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| statshog-1.0.6-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 40.6 kB
Release files / statshog-1.0.6.tar.gz
| Download URL | statshog-1.0.6.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53f5cddd809266b13405206ee3717cc26d47663485611c0c1bcb1e8221469188
|
|
BLAKE2b-256 checksum How to use checksums |
b38820ee9ac030520c2817f93e545005b631283be05f990ae415c444beb52792
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|
Release files / statshog-1.0.6-py2.py3-none-any.whl
| Download URL | statshog-1.0.6-py2.py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0b7948df83a0d5de68a2479f14679cd7d26cd28e2488779de19e0a099c4841d8
|
|
BLAKE2b-256 checksum How to use checksums |
70afc609ab70f4cba573c5c5aa6e091cdddafe2b36e037f37031fa5cef2e9bc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|