]> granicus.if.org Git - sysstat/commitdiff
iostat: Indicate that flush ops are counted as writes before being
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 22 Dec 2019 11:05:36 +0000 (12:05 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 22 Dec 2019 11:05:36 +0000 (12:05 +0100)
merged

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c
man/iostat.in
rd_stats.c

index 89bf2d0500ebbcb25068a529589406e43246fa05..1d3c8e17dd2f75fb98186457053618653cd2d957 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -986,6 +986,7 @@ void write_plain_ext_stat(unsigned long long itv, int fctr, int hpart,
 
        if (DISPLAY_SHORT_OUTPUT(flags)) {
                /* tps */
+               /* Origin (unmerged) flush operations are counted as writes */
                cprintf_f(NO_UNIT, 1, 8, 2,
                          S_VALUE(ioj->rd_ios + ioj->wr_ios + ioj->dc_ios,
                                  ioi->rd_ios + ioi->wr_ios + ioi->dc_ios, itv));
@@ -1149,6 +1150,7 @@ void write_json_ext_stat(int tab, unsigned long long itv, int fctr,
 
        if (DISPLAY_SHORT_OUTPUT(flags)) {
                printf("\"tps\": %.2f, \"",
+                      /* Origin (unmerged) flush operations are counted as writes */
                       S_VALUE(ioj->rd_ios + ioj->wr_ios + ioj->dc_ios,
                               ioi->rd_ios + ioi->wr_ios + ioi->dc_ios, itv));
                if (DISPLAY_MEGABYTES(flags)) {
@@ -1390,6 +1392,7 @@ void write_plain_basic_stat(unsigned long long itv, int fctr,
 
        /* tps */
        cprintf_f(NO_UNIT, 1, 8, 2,
+                 /* Origin (unmerged) flush operations are counted as writes */
                  S_VALUE(ioj->rd_ios + ioj->wr_ios + ioj->dc_ios,
                          ioi->rd_ios + ioi->wr_ios + ioi->dc_ios, itv));
 
@@ -1450,6 +1453,7 @@ void write_json_basic_stat(int tab, unsigned long long itv, int fctr,
        xprintf0(tab,
                 "{\"disk_device\": \"%s\", \"tps\": %.2f, ",
                 devname,
+                /* Origin (unmerged) flush operations are counted as writes */
                 S_VALUE(ioj->rd_ios + ioj->wr_ios + ioj->dc_ios,
                         ioi->rd_ios + ioi->wr_ios + ioi->dc_ios, itv));
        if (DISPLAY_KILOBYTES(flags)) {
@@ -1636,7 +1640,7 @@ void write_stats(int curr, struct tm *rectime, int skip)
 
                                ioi = d->dev_stats[curr];
                                ioj = d->dev_stats[!curr];
-
+                               /* Origin (unmerged) flush operations are counted as writes */
                                if (!DISPLAY_UNFILTERED(flags)) {
                                        if (!ioi->rd_ios && !ioi->wr_ios && !ioi->dc_ios)
                                                continue;
index d83e8ce934b972239fcc2b2a600bb767c3d3e3e1..4120a9c1473d05263d812bd9f31439b3b7842ee0 100644 (file)
@@ -221,6 +221,7 @@ The number (after merges) of discard requests completed per second for the devic
 .RS
 The number (after merges) of flush requests completed per second for the device.
 This counts flush requests executed by disks. Flush requests are not tracked for partitions.
+Before being merged, flush operations are counted as writes.
 
 .RE
 .B sec/s (kB/s, MB/s)
index 2569fae28e8c91f9d8fd71e820e4bed36c4ffdc8..e17377ba0ba583b4aa833a9e48618539ca087379 100644 (file)
@@ -373,6 +373,7 @@ void compute_ext_disk_stats(struct stats_disk *sdc, struct stats_disk *sdp,
        /*
         * Kernel gives ticks already in milliseconds for all platforms
         * => no need for further scaling.
+        * Origin (unmerged) flush operations are counted as writes.
         */
        xds->await = (sdc->nr_ios - sdp->nr_ios) ?
                ((sdc->rd_ticks - sdp->rd_ticks) + (sdc->wr_ticks - sdp->wr_ticks) + (sdc->dc_ticks - sdp->dc_ticks)) /