]> granicus.if.org Git - sysstat/commitdiff
SVG: Fix how bar graphs are displayed for fs statistics
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 1 Jul 2016 10:55:22 +0000 (12:55 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 1 Jul 2016 10:55:22 +0000 (12:55 +0200)
Comment in code stating that "bar graphs should not extend over previous
interval because %values are not calculated over a time interval but are
instantaneous values" is wrong. Doing this implies loosing the first
value and is not consistent with how bar graphs are displayed for other
activities.

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

index 3b1823e3a720b5b79f1a64fb5353d906ff4953c1..faa9f6d8cc3d88bd9e2ac738448b55a7defa4e95 100644 (file)
@@ -4380,7 +4380,6 @@ __print_funct_t svg_print_filesystem_stats(struct activity *a, int curr, int act
        char *item_name;
        double tval;
        int i, k, pos, restart;
-       unsigned long dt;
 
        if (action & F_BEGIN) {
                /*
@@ -4441,18 +4440,6 @@ __print_funct_t svg_print_filesystem_stats(struct activity *a, int curr, int act
                                        restart = svg_p->restart;
                                }
                        }
-                       if (restart) {
-                               /*
-                                * If restart is TRUE then line graphs will be discontinuous.
-                                * And bar graphs should not extend over previous interval because
-                                * here %values are not calculated over a time interval but are
-                                * instantaneous values.
-                                */
-                               dt = 0;
-                       }
-                       else {
-                               dt = svg_p->dt;
-                       }
 
                        /* Check for min/max values */
 
@@ -4529,13 +4516,13 @@ __print_funct_t svg_print_filesystem_stats(struct activity *a, int curr, int act
                                 0.0,
                                 sfc->f_blocks ?
                                 SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks) : 0.0,
-                                out + pos + 2, outsize + pos + 2, dt);
+                                out + pos + 2, outsize + pos + 2, svg_p->dt);
                        /* %fsused */
                        brappend(record_hdr->ust_time - svg_p->ust_time_ref,
                                 0.0,
                                 sfc->f_blocks ?
                                 SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks) : 0.0,
-                                out + pos + 3, outsize + pos + 3, dt);
+                                out + pos + 3, outsize + pos + 3, svg_p->dt);
                        /* Ifree */
                        lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                                 ((double) sfc->f_ffree) / 1000,
@@ -4549,7 +4536,7 @@ __print_funct_t svg_print_filesystem_stats(struct activity *a, int curr, int act
                                 0.0,
                                 sfc->f_files ?
                                 SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files) : 0.0,
-                                out + pos + 6, outsize + pos + 6, dt);
+                                out + pos + 6, outsize + pos + 6, svg_p->dt);
                }
        }