[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/7] simplebench: bench_one(): support count=1
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 5/7] simplebench: bench_one(): support count=1 |
Date: |
Fri, 29 Jan 2021 19:50:28 +0300 |
statistics.stdev raises if sequence length is less than two. Support
that case by hand.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
scripts/simplebench/simplebench.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/simplebench/simplebench.py
b/scripts/simplebench/simplebench.py
index 78d90faf4d..407e95cec3 100644
--- a/scripts/simplebench/simplebench.py
+++ b/scripts/simplebench/simplebench.py
@@ -92,7 +92,10 @@ def bench_one(test_func, test_env, test_case, count=5,
initial_run=True,
dim = 'seconds'
result['dimension'] = dim
result['average'] = statistics.mean(r[dim] for r in succeeded)
- result['stdev'] = statistics.stdev(r[dim] for r in succeeded)
+ if len(succeeded) == 1:
+ result['stdev'] = 0
+ else:
+ result['stdev'] = statistics.stdev(r[dim] for r in succeeded)
if len(succeeded) < count:
result['n-failed'] = count - len(succeeded)
--
2.29.2
- [PATCH 0/7] qcow2: compressed write cache, Vladimir Sementsov-Ogievskiy, 2021/01/29
- [PATCH 1/7] qemu/queue: add some useful QLIST_ and QTAILQ_ macros, Vladimir Sementsov-Ogievskiy, 2021/01/29
- [PATCH 3/7] block/qcow2: use compressed write cache, Vladimir Sementsov-Ogievskiy, 2021/01/29
- [PATCH 2/7] block/qcow2: introduce cache for compressed writes, Vladimir Sementsov-Ogievskiy, 2021/01/29
- [PATCH 4/7] simplebench: bench_one(): add slow_limit argument, Vladimir Sementsov-Ogievskiy, 2021/01/29
- [PATCH 6/7] simplebench/bench-backup: add --compressed option, Vladimir Sementsov-Ogievskiy, 2021/01/29
- [PATCH 5/7] simplebench: bench_one(): support count=1,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 7/7] simplebench/bench-backup: add target-cache argument, Vladimir Sementsov-Ogievskiy, 2021/01/29
- Re: [PATCH 0/7] qcow2: compressed write cache, no-reply, 2021/01/29