+ /*
+ * Compute both read and write rates for the interval.
+ */
+ for (ddir = DDIR_READ; ddir <= DDIR_WRITE; ddir++) {
+ uint64_t delta;
+
+ delta = td->this_io_blocks[ddir] - td->stat_io_blocks[ddir];
+ if (!delta)
+ continue; /* No entries for interval */
+
+ iops = (delta * 1000) / spent;
+ add_stat_sample(&ts->iops_stat[ddir], iops);