Debian Codegraph @

tests/conftest.py

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1
2 def pytest_benchmark_update_json(config, benchmarks, output_json):
3 """Calculate compression/decompression speed and add as extra_info"""
4 for benchmark in output_json["benchmarks"]:
5 if "data_size" in benchmark["extra_info"]:
6 rate = benchmark["extra_info"].get("data_size", 0.0) / benchmark["stats"]["mean"]
7 benchmark["extra_info"]["rate"] = rate
8
9
10 def pytest_benchmark_update_machine_info(config, machine_info):
11 cpuinfo = pytest.importorskip("cpuinfo")
12
13 cpu_info = cpuinfo.get_cpu_info()
14 brand = cpu_info.get("brand_raw", None)
15 if brand is None:
16 brand = "{} core(s) {} CPU ".format(cpu_info.get("count", "unknown"), cpu_info.get("arch", "unknown"))
17 machine_info["cpu"]["brand"] = brand
18 machine_info["cpu"]["hz_actual_friendly"] = cpu_info.get("hz_actual_friendly", "unknown")