t/io_uring: display IOPS in millions if it gets large enough test
authorJens Axboe <axboe@kernel.dk>
Tue, 19 Jul 2022 13:04:31 +0000 (07:04 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Jul 2022 13:29:03 +0000 (07:29 -0600)
If it's above 10000K IOPS, just display in millions with two decimals.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index 100359129cf07bc2f040a7d2037965bb33136da9..795ddcb7c7952fc9f32c89b48bfc4dd66d3ec46c 100644 (file)
@@ -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);