Merge branch 'master' into client-server
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 4dcb1fce44dbbeb4478de8154e502af4eb9f7d32..d1f66a949293310f166690089438e2a883f9feec 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1293,6 +1293,8 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u,
 
        if (!td->o.disable_bw)
                add_bw_sample(td, idx, bytes, &icd->time);
+
+       add_iops_sample(td, idx, &icd->time);
 }
 
 static void io_completed(struct thread_data *td, struct io_u *io_u,
@@ -1332,6 +1334,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                int ret;
 
                td->io_blocks[idx]++;
+               td->this_io_blocks[idx]++;
                td->io_bytes[idx] += bytes;
                td->this_io_bytes[idx] += bytes;
 
@@ -1347,7 +1350,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                        }
                }
 
-               if (ramp_time_over(td)) {
+               if (ramp_time_over(td) && td->runstate == TD_RUNNING) {
                        account_io_completion(td, io_u, icd, idx, bytes);
 
                        if (__should_check_rate(td, idx)) {