]> granicus.if.org Git - sysstat/commitdiff
SVG: Make graphe discontinuous for disconnected devices
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 22 Jan 2021 17:19:33 +0000 (18:19 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 22 Jan 2021 17:19:33 +0000 (18:19 +0100)
Make SVG graph discontinuous for devices which have been unregistered
(disconnected) then registered (connected) again during the same time
interval.

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

index 864f8a3c1e85dc2810174e939d77ed3de8f3de2d..d41edb694d249cd24e01225c906a93e937e263d3 100644 (file)
@@ -2185,6 +2185,7 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s
                        if (j < 0) {
                                /* This is a newly registered interface. Previous stats are zero */
                                sdp = &sdpzero;
+                               restart = TRUE;
                        }
                        else {
                                sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
@@ -2415,6 +2416,7 @@ __print_funct_t svg_print_net_dev_stats(struct activity *a, int curr, int action
                        if (j < 0) {
                                /* This is a newly registered interface. Previous stats are zero */
                                sndp = &sndzero;
+                               restart = TRUE;
                        }
                        else {
                                sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
@@ -2593,6 +2595,7 @@ __print_funct_t svg_print_net_edev_stats(struct activity *a, int curr, int actio
                /* For each network interfaces structure */
                for (i = 0; i < a->nr[curr]; i++) {
                        snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
+
                        if (!strcmp(snedc->interface, ""))
                                /* Empty structure: This is the end of the list */
                                break;
@@ -2635,6 +2638,7 @@ __print_funct_t svg_print_net_edev_stats(struct activity *a, int curr, int actio
                        if (j < 0) {
                                /* This is a newly registered interface. Previous stats are zero */
                                snedp = &snedzero;
+                               restart = TRUE;
                        }
                        else {
                                snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
@@ -5038,6 +5042,7 @@ __print_funct_t svg_print_fchost_stats(struct activity *a, int curr, int action,
                        if (!found) {
                                /* This is a newly registered host */
                                sfcp = &sfczero;
+                               restart = TRUE;
                        }
 
                        /*