wolph / python-statsd

Python Client for the Etsy NodeJS Statsd Server
http://readthedocs.org/docs/python-statsd/en/latest/
BSD 3-Clause "New" or "Revised" License
110 stars 39 forks source link

Turning service OFF #15

Closed alfredodeza closed 12 years ago

alfredodeza commented 12 years ago

There is currently no way to turn this service OFF. Given that I have a need for multiple different environments, some of them should be turned OFF.

The way I am currently approaching this right now is by setting bogus values to the Connection object so that metrics are not firing to the right place.

This is far from optimal, and I would ideally like to set a flag to the Connection class that turns ON/OFF the service (ON by default).

If this is accepted as an issue, I can have a pull request ready by the end of the day with tests and docs :)

wolph commented 12 years ago

Good point, since I usually use this library together with https://github.com/WoLpH/django-statsd/ I never had the issue myself (that library does have support for this, simply set the host to None).

If you're willing to create a pull request, that would be great!

wolph commented 12 years ago

Thanks for the great fix!