monkinetic weblog

Steve Ivy's Weblog - Since 1999 - XII Ed.

Python StatsD Server

Thanks to Joshua Frederick (github user jfred), we now have an actual Python implementation of the statsd server, so if you don’t want to install node.js (though why wouldn’t you? :–) ) you can run it all in python.

from pystatsd import Client, Server

# client usage
sc = Client('example.org',8125)

sc.timing('python_test.time',500)
sc.increment('python_test.inc_int')
sc.decrement('python_test.decr_int')

# server usage
srvr = Server(pct_threshold=90, 
  graphite_port=2003, graphite_host='localhost')
srvr.serve()

Get the code (now version 0.1.1) from Github or Pypi

My name is Steve Ivy and I write about technology, the open web, social software, and general nerdity on monkinetic.com. You should follow me on Twitter or subscribe to this blog if you like what you're reading. I spend my days hacking Movable Type, python, Django, and various other efforts at Wallrazer. This is my personal site.