django_statsd è un middleware Djangi che utilizza python-statsd per registrare query e durate a statsd.
- Python Statsd
& Nbsp; https: //github.com/WoLpH/python-statsd
- Grafite
& Nbsp; http: //graphite.wikidot.com
- Statsd
& Nbsp; codice: https://github.com/etsy/statsd
& Nbsp; post del blog: http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/
Installa
Per installare semplicemente eseguire python setup.py install. Se si desidera eseguire i test prima, python eseguire setup.py nosetests
Utilizzo
Basta aggiungere django_statsd alle INSTALLED_APPS e aggiungere django_statsd.middleware.TimingMiddleware a MIDDLEWARE_CLASSES
Uso avanzato
& Nbsp; >>> def some_view (richiesta):
& Nbsp; ... con request.timings ('something_to_time'):
& Nbsp; ... # fare qualcosa qui
& Nbsp; ... passaggio
& Nbsp; >>>
& Nbsp; >>> def some_view (richiesta):
& Nbsp; ... request.timings.start ('something_to_time')
& Nbsp; ... # fare qualcosa qui
& Nbsp; ... request.timings.stop('something_to_time')
Requirements:
- Python
- Django
I commenti non trovato