INNER CODE UNIT · Python

compare

mongodb/mongo-csharp-driver · benchmarks/MongoDB.Driver.Benchmarks/scripts/compare-results.py:22

def compare(files):
    data = {}
    jsons = [json.load(f) for f in files]
    for j in jsons:
        for result in j:
            data[result['info']['test_name']] = []

    for j in jsons:
        for name in data:
            for result in j:
                if result['info']['test_name'] == name:
                    data[name].append(result['metrics'][0]['value'])
                    break

    col_width = 2 + max(len(name) for name in data)
    file_width = 2 + max(len(f.name) for f in files)
    print(" " * file_width + "".join(name.ljust(col_width) for name in data))
    for i, f in enumerate(files):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…