markus/main.py
def timer_decorator(self, stat, tags=None):
        """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.

        """
        def _inner(fun):
            @wraps(fun)
            def _timer_decorator(*args, **kwargs):
                with self.timer(stat, tags):
                    return fun(*args, **kwargs)
            return _timer_decorator
        return _inner
def timer_decorator(self, stat, tags=None):
        def _inner(fun):
            @wraps(fun)
            def _timer_decorator(*args, **kwargs):
                with self.timer(stat, tags):
                    return fun(*args, **kwargs)
            return _timer_decorator
        return _inner
def timer_decorator ( self , stat , tags = None ) : def _inner ( fun ) : @ wraps ( fun ) def _timer_decorator ( * args , * * kwargs ) : with self . timer ( stat , tags ) : return fun ( * args , * * kwargs ) return _timer_decorator return _inner
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.
Timer decorator for easily computing timings .