summaryrefslogtreecommitdiff
path: root/testing/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests/conftest.py')
-rw-r--r--testing/tests/conftest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py
index 2459307a..bece7609 100644
--- a/testing/tests/conftest.py
+++ b/testing/tests/conftest.py
@@ -235,3 +235,12 @@ if 'pytest_benchmark' in sys.modules:
"""
hostname = os.environ.get('HOST_HOSTNAME', socket.gethostname())
machine_info['host'] = hostname
+
+ def pytest_benchmark_update_json(config, benchmarks, output_json):
+ json_benchmarks = output_json['benchmarks']
+ for benchmark in benchmarks:
+ # find the json output that corresponds to this benchmark
+ name = benchmark['name']
+ output = filter(lambda d: d['name'] == name, json_benchmarks).pop()
+ # update output stats with previously saved values
+ output['stats']['cpu_percent'] = benchmark.stats.cpu_percent