]> granicus.if.org Git - sysstat/commitdiff
SVG: Draw txkB/s and rxkB/s network metrics to scale
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 4 Mar 2016 14:43:02 +0000 (15:43 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 4 Mar 2016 14:43:02 +0000 (15:43 +0100)
The metrics are expressed in kB/s whereas the corresponding counters are
saved in B/s. So recalculate min and max values in kB/s before drawing
graphs.

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

index 09050276305e90532dfeb7cc877b077a42ae1930..6978a3af78177302c25e90e64b5d3404fd31fd66 100644 (file)
@@ -767,6 +767,11 @@ __print_funct_t svg_print_net_dev_stats(struct activity *a, int curr, int action
                                continue;
 
                        pos = i * 7;
+                       /* Recalculate min and max values in kB, not in B */
+                       *(spmin + pos + 2) /= 1024;
+                       *(spmax + pos + 2) /= 1024;
+                       *(spmin + pos + 3) /= 1024;
+                       *(spmax + pos + 3) /= 1024;
                        draw_activity_graphs(a, title, g_title, sndc->interface, group,
                                             spmin + pos, spmax + pos, out + pos, outsize + pos,
                                             svg_p, record_hdr);