Skip to content

Instantly share code, notes, and snippets.

@dhepper
dhepper / statsd_instrument.py
Created November 8, 2012 17:02 — forked from chooper/statsd_instrument.py
Decorator to quickly add statsd (graphite) instrumentation to Celery task functions.
"""Decorator to quickly add statsd (graphite) instrumentation to Celery
task functions.
With some slight modification, this could be used to instrument just
about any (non-celery) function and be made abstract enough to customize
metric names, etc.
Stats reported include number of times the task was accepted by a worker
(`started`), the number of successes, and the number of times the task
raised an exception. In addition, it also reports how long the task took
@dhepper
dhepper / Guardfile
Created February 29, 2012 10:34 — forked from skade/Guardfile
Poor man's CI, Ruby edition
# gem install guard guard-shell; guard
guard 'shell' do
watch(%r{(.+)\.py}) do |m|
`django-admin.py test main`
end
end