qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 12/15] scripts/simplebench: support iops


From: Max Reitz
Subject: Re: [PATCH v6 12/15] scripts/simplebench: support iops
Date: Fri, 25 Sep 2020 10:54:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 18.09.20 20:19, Vladimir Sementsov-Ogievskiy wrote:
> Support benchmarks returning not seconds but iops. We'll use it for
> further new test.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  scripts/simplebench/simplebench.py | 35 +++++++++++++++++++++++-------
>  1 file changed, 27 insertions(+), 8 deletions(-)
> 
> diff --git a/scripts/simplebench/simplebench.py 
> b/scripts/simplebench/simplebench.py
> index 59e7314ff6..716d7fe9b2 100644
> --- a/scripts/simplebench/simplebench.py
> +++ b/scripts/simplebench/simplebench.py

[...]

> @@ -34,6 +37,7 @@ def bench_one(test_func, test_env, test_case, count=5, 
> initial_run=True):
>  
>      Returns dict with the following fields:
>          'runs':     list of test_func results
> +        'dimension': dimension of results, may be 'seconds' or 'iops'
>          'average':  average seconds per run (exists only if at least one run

s/seconds/value/ (or something like that)

>                      succeeded)
>          'delta':    maximum delta between test_func result and the average
> @@ -54,11 +58,20 @@ def bench_one(test_func, test_env, test_case, count=5, 
> initial_run=True):
>  
>      result = {'runs': runs}
>  
> -    successed = [r for r in runs if ('seconds' in r)]
> +    successed = [r for r in runs if ('seconds' in r or 'iops' in r)]
>      if successed:

((Pre-existing, but I feel the urge to point it that it should be
“succeeded”.  (Or perhaps “successes”.)

Sorry, not something that should be fixed here, but I just couldn’t
contain myself.))

> -        avg = sum(r['seconds'] for r in successed) / len(successed)
> +        dim = 'iops' if ('iops' in successed[0]) else 'seconds'

I think this line should be dropped, because it’s obsoleted by the
if-else that follows.

> +        if 'iops' in successed[0]:
> +            assert all('iops' in r for r in successed)
> +            dim = 'iops'
> +        else:
> +            assert all('seconds' in r for r in successed)
> +            assert all('iops' not in r for r in successed)
> +            dim = 'seconds'

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]