Patch to make per-thread IOPS more accurate
authorBen England <bengland@redhat.com>
Fri, 27 Feb 2015 15:14:49 +0000 (08:14 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 27 Feb 2015 15:14:49 +0000 (08:14 -0700)
The following small patch to stat.c (using fio 2.2.4 from github)
outputs IOPS field in JSON format as a floating point number instead of
an integer.  This improves accuracy in case where fio --client runs use
lots of threads with single-digit IOPS per thread.  It seems to work,
here's a snippet of output from a short fio run with rate_iops=10 in the
job file.

     "write" : {
        "io_bytes" : 6464,
        "bw" : 646,
        "iops" : 10.10,
        "runtime" : 10000,

Why the patch: IOPS number is rounded to integer in stats.c calls to
num2str().  This doesn't sound like much of a problem because in many
use cases, with large IOPS number the error is negligible.  But in this
use case where we have many threads (we would like to get into the
thousands eventually), the IOPS/thread may be quite low and integer
rounding can introduce significant error.  For example, if we are doing
5,000 IOPS over 1,000 threads, average throughput is 5 IOPS and
potential error is ~20%, but some threads could have much higher error
in IOPS because of integer format.

Signed-off-by: Jens Axboe <axboe@fb.com>

No differences found