[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 18/21] simplebench/results_to_text: improve view of the table
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v7 18/21] simplebench/results_to_text: improve view of the table |
Date: |
Wed, 21 Oct 2020 17:58:56 +0300 |
Move to generic format for floats and percentage for error.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
scripts/simplebench/results_to_text.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/scripts/simplebench/results_to_text.py
b/scripts/simplebench/results_to_text.py
index 58d909ffd9..479f7ac1d4 100644
--- a/scripts/simplebench/results_to_text.py
+++ b/scripts/simplebench/results_to_text.py
@@ -16,11 +16,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+import math
+
+
+def format_value(x, stdev):
+ stdev_pr = stdev / x * 100
+ if stdev_pr < 1.5:
+ # don't care too much
+ return f'{x:.2g}'
+ else:
+ return f'{x:.2g} ± {math.ceil(stdev_pr)}%'
+
def result_to_text(result):
"""Return text representation of bench_one() returned dict."""
if 'average' in result:
- s = '{:.2f} +- {:.2f}'.format(result['average'], result['stdev'])
+ s = format_value(result['average'], result['stdev'])
if 'n-failed' in result:
s += '\n({} failed)'.format(result['n-failed'])
return s
--
2.21.3
- [PATCH v7 08/21] block: introduce preallocate filter, (continued)
- [PATCH v7 08/21] block: introduce preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 09/21] qemu-io: add preallocate mode parameter for truncate command, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 16/21] simplebench: rename ascii() to results_to_text(), Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 07/21] block: bdrv_check_perm(): process children anyway, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 15/21] scripts/simplebench: use standard deviation for +- error, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 10/21] iotests: qemu_io_silent: support --image-opts, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 11/21] iotests.py: execute_setup_common(): add required_fmts argument, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 12/21] iotests: add 298 to test new preallocate filter driver, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 13/21] scripts/simplebench: fix grammar: s/successed/succeeded/, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 17/21] simplebench: move results_to_text() into separate file, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 18/21] simplebench/results_to_text: improve view of the table,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v7 20/21] simplebench/results_to_text: make executable, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 19/21] simplebench/results_to_text: add difference line to the table, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 21/21] scripts/simplebench: add bench_prealloc.py, Vladimir Sementsov-Ogievskiy, 2020/10/21