skip to navigation
skip to content

Not Logged In

sprockets.mixins.statsd 1.0.2

Handler mixins for automated metric reporting

Latest Version: 1.3.1

The RequestMetricsMixin mixin will automatically instrument requests by sending statsd increment and timing values as each request finishes.

Installation

sprockets.mixins.statsd is available on the Python Package Index and can be installed via pip or easy_install:

pip install sprockets.mixins.statsd

Example

The following RequestHandler will automatically increment a request counter and add a request duration timing value to statsd when the request finishes.

from sprockets.handlers.mixins import statsd
from tornado import web

class MyRequestHandler(stats.RequestMetricsMixin,
                       web.RequestHandler):

    def get(self, *args, **kwargs):
        self.finish({'hello': 'world'})

When the request has finished, the following keys would be used:

  • Counter: sprockets.counter.example.RequestHandler.GET.200
  • Timing: sprockets.timers.example.RequestHandler.GET.200
 
File Type Py Version Uploaded on Size
sprockets.mixins.statsd-1.0.2.tar.gz (md5) Source 2014-08-29 7KB
  • Downloads (All Versions):
  • 94 downloads in the last day
  • 904 downloads in the last week
  • 2818 downloads in the last month