def timer_decorator(self, stat, tags=None):
def _inner(fun):<EOL><INDENT>@wraps(fun)<EOL>def _timer_decorator(*args, **kwargs):<EOL><INDENT>with self.timer(stat, tags):<EOL><INDENT>return fun(*args, **kwargs)<EOL><DEDENT><DEDENT>return _timer_decorator<EOL><DEDENT>return _inner<EOL>
Timer decorator for easily computing timings.

        :arg string stat: A period delimited alphanumeric key.

        :arg list-of-strings tags: Each string in the tag consists of a key and
            a value separated by a colon. Tags can make it easier to break down
            metrics for analysis.

            For example ``['env:stage', 'compressed:yes']``.

        For example:

        >>> mymetrics = get_metrics(__name__)

        >>> @mymetrics.timer_decorator('long_function')
        ... def long_function():
        ...     # perform some thing we want to keep metrics on
        ...     pass


        .. Note::

           All timings generated with this are in milliseconds.