[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/9] simplebench: bench_one(): support count=1
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PULL 2/9] simplebench: bench_one(): support count=1 |
Date: |
Tue, 4 May 2021 12:01:06 +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>
Reviewed-by: John Snow <jsnow@redhat.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 0a3035732c..27bc4d4715 100644
--- a/scripts/simplebench/simplebench.py
+++ b/scripts/simplebench/simplebench.py
@@ -83,7 +83,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
- [PULL 0/9] scripts/simplebench patches, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 1/9] simplebench: bench_one(): add slow_limit argument, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 8/9] simplebench/bench-backup: add --drop-caches argument, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 5/9] simplebench/bench_block_job: handle error in BLOCK_JOB_COMPLETED, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 9/9] MAINTAINERS: update Benchmark util: add git tree, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 6/9] simplebench/bench-backup: support qcow2 source files, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 4/9] simplebench/bench-backup: add target-cache argument, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 2/9] simplebench: bench_one(): support count=1,
Vladimir Sementsov-Ogievskiy <=
- [PULL 7/9] simplebench/bench-backup: add --count and --no-initial-run, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PULL 3/9] simplebench/bench-backup: add --compressed option, Vladimir Sementsov-Ogievskiy, 2021/05/04
- Re: [PULL 0/9] scripts/simplebench patches, Vladimir Sementsov-Ogievskiy, 2021/05/11
- Re: [PULL 0/9] scripts/simplebench patches, Peter Maydell, 2021/05/20
- Re: [PULL 0/9] scripts/simplebench patches, Peter Maydell, 2021/05/21