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.
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
Documentation
Requirements
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
Version History
Available at https://sprocketsmixinsstatsd.readthedocs.org/en/latest/history.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for sprockets.mixins.statsd-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ca198b7cfe7b70a333190807c66c7e25a87e96ab2a61da76940a082148523eb |
|
MD5 | 02d5fd05b7aaf1a77da7e160f9df6ddc |
|
BLAKE2b-256 | 051c2c5ca99a7574182726276c7707ccbaa5d600e4c904f1d1e57736570d3c4f |