From 89132cbbfce9249a47730c3667c1896b2465d038 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 19 Jul 2022 07:04:31 -0600 Subject: [PATCH] t/io_uring: display IOPS in millions if it gets large enough If it's above 10000K IOPS, just display in millions with two decimals. Signed-off-by: Jens Axboe --- t/io_uring.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/io_uring.c b/t/io_uring.c index 10035912..795ddcb7 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -1031,7 +1031,9 @@ static void do_finish(const char *reason) struct submitter *s = get_submitter(j); s->finish = 1; } - if (max_iops > 100000) + if (max_iops > 1000000) + printf("Maximum IOPS=%.2fM\n", (double) max_iops / 1000000.0); + else if (max_iops > 100000) printf("Maximum IOPS=%luK\n", max_iops / 1000); else if (max_iops) printf("Maximum IOPS=%lu\n", max_iops); @@ -1541,7 +1543,9 @@ int main(int argc, char *argv[]) bw = iops * (bs / 1048576); else bw = iops / (1048576 / bs); - if (iops > 100000) + if (iops > 10000000) + printf("IOPS=%.2fM, ", (double) iops / 1000000.0); + else if (iops > 100000) printf("IOPS=%luK, ", iops / 1000); else printf("IOPS=%lu, ", iops); -- 2.25.1