def hist_calls(fn):
    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        _histogram = histogram("%s_calls" % get_qualname(fn))
        rtn = fn(*args, **kwargs)
        if type(rtn) in (int, float):
            _histogram.update(rtn)
        return rtn
    return wrapper
Decorator to check the distribution of return values of a function.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pyformance-0.3.2/pyformance/registry.py/hist_calls