def statistics(f):

    @wraps(f)
    def wrapper(*args, **kwargs):
        t1 = now()
        result = f(*args, **kwargs)
        t2 = now()
        # The queue should never be full, but we can't
        # take the risk to block the request anyway
        try:
            Worker.queue.put_nowait((request.url, t2 - t1))
        except Full:
            pass
        return result
    return wrapper


#
# Web statistics blueprint
#
The decorator used in the application to collect statistics.
dataset/ETHPy150Open yannlambret/flstats/flstats/flstats.py/statistics