From 8c8407fe4525151e3c396adc667e1d4b0aab2c99 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Thu, 4 Mar 2021 11:10:17 +0300 Subject: simplebench/bench-backup: add --drop-caches argument Add an option to drop caches before each test run. It may probably improve reliability of results when testing in cached mode. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/simplebench/bench-backup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/simplebench/bench-backup.py') diff --git a/scripts/simplebench/bench-backup.py b/scripts/simplebench/bench-backup.py index 092fed5816..5a0675c593 100755 --- a/scripts/simplebench/bench-backup.py +++ b/scripts/simplebench/bench-backup.py @@ -156,7 +156,8 @@ def bench(args): }) result = simplebench.bench(bench_func, test_envs, test_cases, - count=args.count, initial_run=args.initial_run) + count=args.count, initial_run=args.initial_run, + drop_caches=args.drop_caches) with open('results.json', 'w') as f: json.dump(result, f, indent=4) print(results_to_text(result)) @@ -221,4 +222,7 @@ Number of test runs per table cell''') Do additional initial run per cell which doesn't count in result, default true''') + p.add_argument('--drop-caches', action='store_true', help='''\ +Do "sync; echo 3 > /proc/sys/vm/drop_caches" before each test run''') + bench(p.parse_args()) -- cgit 1.4.1