]> granicus.if.org Git - sysstat/commitdiff
sar: Update "sar -d" output contents
authorSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Jun 2017 08:12:42 +0000 (10:12 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Jun 2017 08:12:42 +0000 (10:12 +0200)
Replace "rd_sec/s" and "wr_sec/s" fields with "rkB/s" and "wkB/s". These
fields are now expressed in kilobytes instead of sectors. This also make
them consistent with iostat's output.

Replace "avgrq-sz" field with "areq-sz". This field is now expressed in
kilobytes instead of sectors and make it consistent with iostat's output.

Rename "avgqu-sz" field to "aqu-sz" to make it consistent with iostat's
output.

Notes:
1) All those changes don't break the format of sar's binary data files.
The values for rkB/s, wkB/s and areq-sz fields are still saved as a
number of sectors. Only the output displayed onto the screen changes.
2) I plan to keep the original field names (in addition to the new ones)
in sadf's XML and JSON output to keep backward compatibility. This means
you will still get fields named rd_sec, wr_sec and avgrq-sz (expressed
in sectors) in XML and JSON output in addition to the new fields rkB,
wkB and areq-sz expressed in kB.
Field avgqu-sz will still exist too.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
activity.c
pr_stats.c

index 12c5c1630ef93b93e7a80d611f8329c7ef3271ef..dc2864225330f3b35b94c14e8fd5660589436ff0 100644 (file)
@@ -458,7 +458,7 @@ struct activity disk_act = {
        .f_print_avg    = print_disk_stats,
 #endif
 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
-       .hdr_line       = "DEV;tps;rd_sec/s;wr_sec/s;avgrq-sz;avgqu-sz;await;svctm;%util",
+       .hdr_line       = "DEV;tps;rkB/s;wkB/s;areq-sz;aqu-sz;await;svctm;%util",
 #endif
 #ifdef SOURCE_SADF
        .f_render       = render_disk_stats,
index a80f4745e7487d9dece87da9d6b850224671f8b4..50e283093c488f78bd2a6b82f44e0d7f5f219dde 100644 (file)
@@ -969,8 +969,8 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
        memset(&sdpzero, 0, STATS_DISK_SIZE);
 
        if (DISPLAY_UNIT(flags)) {
-               /* Default values unit is sectors */
-               unit = 0;
+               /* Default values unit is kB */
+               unit = 2;
        }
 
        if (dis) {
@@ -1023,11 +1023,11 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
                cprintf_f(-1, 1, 9, 2,
                          S_VALUE(sdp->nr_ios, sdc->nr_ios,  itv));
                cprintf_f(unit, 2, 9, 2,
-                         S_VALUE(sdp->rd_sect, sdc->rd_sect, itv),
-                         S_VALUE(sdp->wr_sect, sdc->wr_sect, itv));
+                         S_VALUE(sdp->rd_sect, sdc->rd_sect, itv) / 2,
+                         S_VALUE(sdp->wr_sect, sdc->wr_sect, itv) / 2);
                cprintf_f(-1, 4, 9, 2,
                          /* See iostat for explanations */
-                         xds.arqsz,
+                         xds.arqsz / 2,
                          S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
                          xds.await,
                          xds.svctm);