]> granicus.if.org Git - sysstat/commitdiff
iostat/sar: Remove service time (svctm) metric
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 4 Nov 2018 09:04:00 +0000 (10:04 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 4 Nov 2018 09:04:00 +0000 (10:04 +0100)
Service time value (displayed as svctm by sar and iostat) could no
longer be trusted and has been made obsolete for several years. So
remove it now from sar (sar -d) and iostat output.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
activity.c
common.h
iostat.c
json_stats.c
pr_stats.c
rd_stats.c
rndr_stats.c
svg_stats.c
xml_stats.c

index e61c7081ea0d28bde5be6e116d848628a972abaa..cb5a5a455c104d628051572459c25225dc9a0cee 100644 (file)
@@ -533,7 +533,7 @@ struct activity disk_act = {
        .f_print_avg    = print_disk_stats,
 #endif
 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
-       .hdr_line       = "DEV;tps;rkB/s;wkB/s;areq-sz;aqu-sz;await;svctm;%util",
+       .hdr_line       = "DEV;tps;rkB/s;wkB/s;areq-sz;aqu-sz;await;%util",
 #endif
        .gtypes_nr      = {STATS_DISK_ULL, STATS_DISK_UL, STATS_DISK_U},
        .ftypes_nr      = {0, 0, 0},
index 050fb6c6ffb057f9bf64a41e058af70c8cea2cf2..547a754564be80558f91f6a58d7e6a000d24d04d 100644 (file)
--- a/common.h
+++ b/common.h
@@ -216,7 +216,6 @@ extern char persistent_name_type[MAX_FILE_LEN];
 struct ext_disk_stats {
        double util;
        double await;
-       double svctm;
        double arqsz;
 };
 
index dd000b4219dfebca4640541d6e7b7353031ea864..7dd12d597f2ac90df35f6975ad1182574f2bd98a 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -1025,7 +1025,7 @@ void write_disk_stat_header(int *fctr, int *tab)
                                printf("    rsec/s    wsec/s");
                        }
                        printf("   rrqm/s   wrqm/s  %%rrqm  %%wrqm r_await w_await"
-                              " aqu-sz rareq-sz wareq-sz  svctm  %%util");
+                              " aqu-sz rareq-sz wareq-sz  %%util");
                }
        }
        else {
@@ -1132,8 +1132,6 @@ void write_plain_ext_stat(unsigned long long itv, int fctr,
                /* rareq-sz  wareq-sz (in kB, not sectors) */
                cprintf_f(DISPLAY_UNIT(flags) ? UNIT_KILOBYTE : NO_UNIT, 2, 8, 2,
                          xios->rarqsz / 2, xios->warqsz / 2);
-               /* svctm - The ticks output is biased to output 1000 ticks per second */
-               cprintf_f(NO_UNIT, 1, 6, 2, xds->svctm);
                /*
                 * %util
                 * Again: Ticks in milliseconds.
@@ -1217,7 +1215,7 @@ void write_json_ext_stat(int tab, unsigned long long itv, int fctr,
                       xios->wsectors /= fctr);
                printf("\"rrqm/s\": %.2f, \"wrqm/s\": %.2f, \"rrqm\": %.2f, \"wrqm\": %.2f, "
                       "\"r_await\": %.2f, \"w_await\": %.2f, "
-                      "\"aqu-sz\": %.2f, \"rareq-sz\": %.2f, \"wareq-sz\": %.2f,  \"svctm\": %.2f, ",
+                      "\"aqu-sz\": %.2f, \"rareq-sz\": %.2f, \"wareq-sz\": %.2f, ",
                       S_VALUE(ioj->rd_merges, ioi->rd_merges, itv),
                       S_VALUE(ioj->wr_merges, ioi->wr_merges, itv),
                       xios->rrqm_pc,
@@ -1226,8 +1224,7 @@ void write_json_ext_stat(int tab, unsigned long long itv, int fctr,
                       xios->w_await,
                       S_VALUE(ioj->rq_ticks, ioi->rq_ticks, itv) / 1000.0,
                       xios->rarqsz / 2,
-                      xios->warqsz / 2,
-                      xds->svctm);
+                      xios->warqsz / 2);
        }
        printf("\"util\": %.2f}",
                 shi->used ? xds->util / 10.0 / (double) shi->used
index b7ee3876862fe2823c8e3a672e55a34287709c5f..e67e96ecbddec2bb26268e1fdc65e399e3eb43ad 100644 (file)
@@ -755,7 +755,6 @@ __print_funct_t json_print_disk_stats(struct activity *a, int curr, int tab,
                         "\"avgqu-sz\": %.2f, "
                         "\"aqu-sz\": %.2f, "
                         "\"await\": %.2f, "
-                        "\"svctm\": %.2f, "
                         "\"util-percent\": %.2f}",
                         /* Confusion possible here between index and minor numbers */
                         dev_name,
@@ -770,7 +769,6 @@ __print_funct_t json_print_disk_stats(struct activity *a, int curr, int tab,
                         S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,   /* For backward compatibility */
                         S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
                         xds.await,
-                        xds.svctm,
                         xds.util / 10.0);
        }
 
index 5fdbd313ae123687181159c4f9f67cfab677bc53..9cce5010f703a3fc2590c096446796e19dc9c171 100644 (file)
@@ -1074,10 +1074,9 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
                /* See iostat for explanations */
                cprintf_f(unit, 1, 9, 2,
                          xds.arqsz / 2);
-               cprintf_f(NO_UNIT, 3, 9, 2,
+               cprintf_f(NO_UNIT, 2, 9, 2,
                          S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
-                         xds.await,
-                         xds.svctm);
+                         xds.await);
                cprintf_pc(DISPLAY_UNIT(flags), 1, 9, 2,
                           xds.util / 10.0);
                if (DISPLAY_HUMAN_READ(flags)) {
index bf1b3170309a5f0b7d161ca0304d2d239258639b..d4a938b35e11a0d55ed3c901755c9fd16e1c8053 100644 (file)
@@ -369,11 +369,7 @@ void read_uptime(unsigned long long *uptime)
 void compute_ext_disk_stats(struct stats_disk *sdc, struct stats_disk *sdp,
                            unsigned long long itv, struct ext_disk_stats *xds)
 {
-       double tput
-               = ((double) (sdc->nr_ios - sdp->nr_ios)) * 100 / itv;
-
        xds->util  = S_VALUE(sdp->tot_ticks, sdc->tot_ticks, itv);
-       xds->svctm = tput ? xds->util / tput : 0.0;
        /*
         * Kernel gives ticks already in milliseconds for all platforms
         * => no need for further scaling.
index 7b180767da7e36429ad4f47f022d8a98a87ebb07..a54229f968a209a36d9dcce1f1853c54a6d89c73 100644 (file)
@@ -1131,13 +1131,6 @@ __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
                       xds.await,
                       NULL);
 
-               render(isdb, pre, PT_NOFLAG,
-                      "%s\tsvctm", NULL,
-                      cons(sv, dev_name, NULL),
-                      NOVAL,
-                      xds.svctm,
-                      NULL);
-
                render(isdb, pre, pt_newlin,
                       "%s\t%%util", NULL,
                       cons(sv, dev_name, NULL),
index ecb74862fb727182f96008795f352dfef6b214ce..8a75921a59fdb7f87f4cf1cafbdae68fca9ef0d4 100644 (file)
@@ -2013,7 +2013,7 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
 {
        struct stats_disk *sdc, *sdp, sdpzero;
        struct ext_disk_stats xds;
-       int group[] = {1, 2, 2, 2, 1};
+       int group[] = {1, 2, 2, 1, 1};
        int g_type[] = {SVG_LINE_GRAPH, SVG_LINE_GRAPH, SVG_LINE_GRAPH,
                        SVG_LINE_GRAPH, SVG_BAR_GRAPH};
        char *title[] = {"Block devices statistics (1)", "Block devices statistics (2)",
@@ -2022,9 +2022,10 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
        char *g_title[] = {"tps",
                           "rkB/s", "wkB/s",
                           "areq-sz", "aqu-sz",
-                          "await", "svctm",
+                          "await",
                           "%util"};
        int g_fields[] = {0, 1, 2};
+       int nr_arrays = 8;
        unsigned int local_types_nr[] = {1, 0, 0};
        static double *spmin, *spmax;
        static char **out;
@@ -2035,15 +2036,15 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
 
        if (action & F_BEGIN) {
                /*
-                * Allocate arrays (#0..7) that will contain the graphs data
+                * Allocate arrays (#0..6) that will contain the graphs data
                 * and the min/max values.
-                * Also allocate one additional array (#8) for each disk device:
-                * spmax + 8 will contain the device major number,
-                * spmin + 8 will contain the device minor number,
-                * outsize + 8 will contain a positive value (TRUE) if the device
+                * Also allocate one additional array (#7) for each disk device:
+                * spmax + 7 will contain the device major number,
+                * spmin + 7 will contain the device minor number,
+                * outsize + 7 will contain a positive value (TRUE) if the device
                 * has either still not been registered, or has been unregistered.
                 */
-               out = allocate_graph_lines(9 * a->item_list_sz, &outsize, &spmin, &spmax);
+               out = allocate_graph_lines(nr_arrays * a->item_list_sz, &outsize, &spmin, &spmax);
        }
 
        if (action & F_MAIN) {
@@ -2054,7 +2055,7 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
                 * possibly unregistered for all graphs.
                 */
                for (k = 0; k < a->item_list_sz; k++) {
-                       unregistered = outsize + k * 9 + 8;
+                       unregistered = outsize + k * nr_arrays + 7;
                        if (*unregistered == FALSE) {
                                *unregistered = MAYBE;
                        }
@@ -2076,15 +2077,15 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
 
                        /* Look for corresponding graph */
                        for (k = 0; k < a->item_list_sz; k++) {
-                               if ((sdc->major == *(spmax + k * 9 + 8)) &&
-                                   (sdc->minor == *(spmin + k * 9 + 8)))
+                               if ((sdc->major == *(spmax + k * nr_arrays + 7)) &&
+                                   (sdc->minor == *(spmin + k * nr_arrays + 7)))
                                        /* Graph found! */
                                        break;
                        }
                        if (k == a->item_list_sz) {
                                /* Graph not found: Look for first free entry */
                                for (k = 0; k < a->item_list_sz; k++) {
-                                       if (*(spmax + k * 9 + 8) == -DBL_MAX)
+                                       if (*(spmax + k * nr_arrays + 7) == -DBL_MAX)
                                                break;
                                }
                                if (k == a->item_list_sz) {
@@ -2096,8 +2097,8 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
                                        continue;
                                }
                        }
-                       pos = k * 9;
-                       unregistered = outsize + pos + 8;
+                       pos = k * nr_arrays;
+                       unregistered = outsize + pos + 7;
 
                        /*
                         * If current device was marked as previously unregistered,
@@ -2109,10 +2110,10 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
                        }
                        *unregistered = FALSE;
 
-                       if (*(spmax + pos + 8) == -DBL_MAX) {
+                       if (*(spmax + pos + 7) == -DBL_MAX) {
                                /* Save device major and minor numbers (if not already done) */
-                               *(spmax + pos + 8) = sdc->major;
-                               *(spmin + pos + 8) = sdc->minor;
+                               *(spmax + pos + 7) = sdc->major;
+                               *(spmin + pos + 7) = sdc->minor;
                        }
 
                        j = check_disk_reg(a, curr, !curr, i);
@@ -2163,17 +2164,11 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
                        if (xds.await > *(spmax + pos + 5)) {
                                *(spmax + pos + 5) = xds.await;
                        }
-                       if (xds.svctm < *(spmin + pos + 6)) {
-                               *(spmin + pos + 6) = xds.svctm;
-                       }
-                       if (xds.svctm > *(spmax + pos + 6)) {
-                               *(spmax + pos + 6) = xds.svctm;
+                       if ((xds.util / 10.0) < *(spmin + pos + 6)) {
+                               *(spmin + pos + 6) = xds.util / 10.0;
                        }
-                       if ((xds.util / 10.0) < *(spmin + pos + 7)) {
-                               *(spmin + pos + 7) = xds.util / 10.0;
-                       }
-                       if ((xds.util / 10.0) > *(spmax + pos + 7)) {
-                               *(spmax + pos + 7) = xds.util / 10.0;
+                       if ((xds.util / 10.0) > *(spmax + pos + 6)) {
+                               *(spmax + pos + 6) = xds.util / 10.0;
                        }
 
                        /* tps */
@@ -2200,19 +2195,15 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
                        lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                                 xds.await,
                                 out + pos + 5, outsize + pos + 5, restart);
-                       /* svctm */
-                       lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
-                                xds.svctm,
-                                out + pos + 6, outsize + pos + 6, restart);
                        /* %util */
                        brappend(record_hdr->ust_time - svg_p->ust_time_ref,
                                 0.0, xds.util / 10.0,
-                                out + pos + 7, outsize + pos + 7, svg_p->dt);
+                                out + pos + 6, outsize + pos + 6, svg_p->dt);
                }
 
                /* Mark devices not seen here as now unregistered */
                for (k = 0; k < a->item_list_sz; k++) {
-                       unregistered = outsize + k * 9 + 8;
+                       unregistered = outsize + k * nr_arrays + 7;
                        if (*unregistered != FALSE) {
                                *unregistered = TRUE;
                        }
@@ -2224,12 +2215,12 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
 
                for (i = 0; i < a->item_list_sz; i++) {
                        /* Check if there is something to display */
-                       pos = i * 9;
+                       pos = i * nr_arrays;
                        if (!**(out + pos))
                                continue;
 
                        /* Get device name */
-                       item_name = get_sa_devname(*(spmax + pos + 8), *(spmin + pos + 8), flags);
+                       item_name = get_sa_devname(*(spmax + pos + 7), *(spmin + pos + 7), flags);
 
                        if (draw_activity_graphs(a->g_nr, g_type,
                                                 title, g_title, item_name, group,
index a6d342df598eb33cbca7b72997888b2d388babaa..505a1ebd26cd85eddb5de5213c25d9f7702b7c2b 100644 (file)
@@ -735,7 +735,6 @@ __print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab,
                        "avgqu-sz=\"%.2f\" "
                        "aqu-sz=\"%.2f\" "
                        "await=\"%.2f\" "
-                       "svctm=\"%.2f\" "
                        "util-percent=\"%.2f\"/>",
                        /* Confusion possible here between index and minor numbers */
                        dev_name,
@@ -750,7 +749,6 @@ __print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab,
                        S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,    /* For backward compatibility */
                        S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
                        xds.await,
-                       xds.svctm,
                        xds.util / 10.0);
        }