def display(name, timings):
    cols = ('Action', 'Count', 'Miss', 'Median', 'P90', 'P99', 'Max', 'Total')
    template = ' '.join(['%9s'] * len(cols))

    print()
    print(' '.join(['=' * 9] * len(cols)))
    print('Timings for %s' % name)
    print('-'.join(['-' * 9] * len(cols)))
    print(template % cols)
    print(' '.join(['=' * 9] * len(cols)))

    len_total = sum_total = 0

    for action in ['get', 'set', 'delete']:
        values = timings[action]
        len_total += len(values)
        sum_total += sum(values)

        print(template % (
            action,
            len(values),
            len(timings.get(action + '-miss', [])),
            secs(percentile(values, 0.5)),
            secs(percentile(values, 0.9)),
            secs(percentile(values, 0.99)),
            secs(percentile(values, 1.0)),
            secs(sum(values)),
        ))

    totals = ('Total', len_total, '', '', '', '', '', secs(sum_total))
    print(totals % template)
    print(' '.join(['=' * 9] * len(cols)))
    print()
dataset/ETHPy150Open grantjenks/python-diskcache/tests/utils.py/display/swapped operands of `%`