Skip to main content

Handler mixins for automated metric reporting

Project description

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

Version Downloads Status Coverage License

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

Project details


Release history Release notifications

History Node

1.3.1

History Node

1.3.0

History Node

1.2.1

History Node

1.1.0

History Node

1.0.4

History Node

1.0.3

This version
History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
sprockets.mixins.statsd-1.0.2.tar.gz (7.9 kB) Copy SHA256 hash SHA256 Source None Aug 29, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page