pip install statsd
{
"address": "127.0.0.1",
"port": 8125,
"protocol": "udp"
}
python
import statsd
statsd_client = statsd.StatsClient(host='localhost', port=8125)
statsd_client.incr('page.views')
with statsd_client.timer('task.duration'):
task()
statsd statsd.conf