Metadata-Version: 1.1
Name: sprockets.mixins.statsd
Version: 1.0.4
Summary: Handler mixins for automated metric reporting
Home-page: https://github.com/sprockets/sprockets.mixins.statsd.git
Author: AWeber Communications
Author-email: api@aweber.com
License: Copyright (c) 2014 AWeber Communications
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 * Neither the name of Sprockets nor the names of its
   contributors may be used to endorse or promote products derived from this
   software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description: sprockets.mixins.statsd
        =======================
        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 <https://pypi.python.org/pypi/sprockets.mixins.statsd>`_
        and can be installed via ``pip`` or ``easy_install``:
        
        .. code:: bash
        
          pip install sprockets.mixins.statsd
        
        Documentation
        -------------
        https://sprocketsmixinsstatsd.readthedocs.org/
        
        Requirements
        ------------
        -  `sprockets.client.statsd <https://github.com/sprockets/sprockets.client.statsd>`_
        
        Example
        -------
        The following ``RequestHandler`` will automatically increment a request counter
        and add a request duration timing value to statsd when the request finishes.
        
        .. code:: python
        
            from sprockets.mixins import statsd
            from tornado import web
        
            class MyRequestHandler(statsd.RequestMetricsMixin,
                                   web.RequestHandler):
        
                def prepare(self):
                    self.statsd_prefix = 'some.overriden.value'
                    super(MyRequestHandler, self).prepare()
        
                def get(self, *args, **kwargs):
                    self.finish({'hello': 'world'})
        
                def on_finish(self):
                    super(MyRequestHandler, self).on_finish()
                    self.do_cleanup_things()
        
        
        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``
        
        Mixin Behavior
        --------------
        Whenever you mix in a class in Python always ensure that the mixins, which
        should inherit from ``object``, are the first ones in the inheritance list.
        The concrete class, in this case `web.RequestHandler` should be the final
        class inherited.
        
        Should your Request Handler extend the ``finish`` or the ``prepare`` methods
        ensure that your call ``super`` otherwise you may run into strange behavior.
        
        Version History
        ---------------
        Available at https://sprocketsmixinsstatsd.readthedocs.org/en/latest/history.html
        
        .. |Version| image:: https://badge.fury.io/py/sprockets.mixins.statsd.svg?
           :target: http://badge.fury.io/py/sprockets.mixins.statsd
        
        .. |Status| image:: https://travis-ci.org/sprockets/sprockets.mixins.statsd.svg?branch=master
           :target: https://travis-ci.org/sprockets/sprockets.mixins.statsd
        
        .. |Coverage| image:: https://img.shields.io/coveralls/sprockets/sprockets.mixins.statsd.svg?
           :target: https://coveralls.io/r/sprockets/sprockets.mixins.statsd
        
        .. |Downloads| image:: https://pypip.in/d/sprockets.mixins.statsd/badge.svg?
           :target: https://pypi.python.org/pypi/sprockets.mixins.statsd
        
        .. |License| image:: https://pypip.in/license/sprockets.mixins.statsd/badge.svg?
           :target: https://sprocketsmixinsstatsd.readthedocs.org
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
