From f7b68c47146f7f9faab526c0089004dd0f75c752 Mon Sep 17 00:00:00 2001 From: Aaron Daniels Date: Thu, 15 Sep 2016 01:24:23 +1000 Subject: [PATCH] fix: Graph formatting for udp-jitter graphs. (#4433) --- .../graphs/device/sla_jitter-icpif.inc.php | 7 ++++--- .../graphs/device/sla_jitter-latency.inc.php | 20 ++++++++++--------- .../graphs/device/sla_jitter-loss.inc.php | 20 ++++++++++--------- .../graphs/device/sla_jitter-lost.inc.php | 17 +++++++++------- .../graphs/device/sla_jitter-mos.inc.php | 11 +++++----- .../includes/graphs/device/sla_jitter.inc.php | 20 ++++++++++--------- 6 files changed, 53 insertions(+), 42 deletions(-) diff --git a/html/includes/graphs/device/sla_jitter-icpif.inc.php b/html/includes/graphs/device/sla_jitter-icpif.inc.php index 4563da726cbc..fc2320afa7b6 100644 --- a/html/includes/graphs/device/sla_jitter-icpif.inc.php +++ b/html/includes/graphs/device/sla_jitter-icpif.inc.php @@ -18,11 +18,12 @@ $rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); if (file_exists($rrd_filename)) { - $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " COMMENT:' Cur Min Max Avg\\n'"; $rrd_options .= " DEF:ICPIF=" . $rrd_filename . ":ICPIF:AVERAGE "; - $rrd_options .= " LINE1.25:ICPIF#0000ee:'ICPIF ' "; + $rrd_options .= " LINE1.25:ICPIF#0000ee:'ICPIF ' "; $rrd_options .= " GPRINT:ICPIF:LAST:%3.0lf "; $rrd_options .= " GPRINT:ICPIF:MIN:%3.0lf "; - $rrd_options .= " GPRINT:ICPIF:MAX:%3.0lf\\\l "; + $rrd_options .= " GPRINT:ICPIF:MAX:%3.0lf "; + $rrd_options .= " GPRINT:ICPIF:AVERAGE:'%3.0lf'\\\l "; } diff --git a/html/includes/graphs/device/sla_jitter-latency.inc.php b/html/includes/graphs/device/sla_jitter-latency.inc.php index a363dbfbe761..027b37cf41b6 100644 --- a/html/includes/graphs/device/sla_jitter-latency.inc.php +++ b/html/includes/graphs/device/sla_jitter-latency.inc.php @@ -18,17 +18,19 @@ $rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); if (file_exists($rrd_filename)) { - $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " COMMENT:' Cur Min Max Avg\\n'"; $rrd_options .= " DEF:SD=" . $rrd_filename . ":OWAvgSD:AVERAGE "; - $rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; - $rrd_options .= " GPRINT:SD:LAST:%3.0lf "; - $rrd_options .= " GPRINT:SD:MIN:%3.0lf "; - $rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst (ms) ' "; + $rrd_options .= " GPRINT:SD:LAST:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:MIN:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:MAX:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:AVERAGE:'%5.2lf'\\\l "; $rrd_options .= " DEF:DS=" . $rrd_filename . ":OWAvgDS:AVERAGE "; - $rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; - $rrd_options .= " GPRINT:DS:LAST:%3.0lf "; - $rrd_options .= " GPRINT:DS:MIN:%3.0lf "; - $rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:DS#008C00:'Dst to Src (ms) ' "; + $rrd_options .= " GPRINT:DS:LAST:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:MIN:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:MAX:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:AVERAGE:'%5.2lf'\\\l "; } diff --git a/html/includes/graphs/device/sla_jitter-loss.inc.php b/html/includes/graphs/device/sla_jitter-loss.inc.php index 8c31fae3ed40..21976ccb1cfe 100644 --- a/html/includes/graphs/device/sla_jitter-loss.inc.php +++ b/html/includes/graphs/device/sla_jitter-loss.inc.php @@ -18,17 +18,19 @@ $rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); if (file_exists($rrd_filename)) { - $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " COMMENT:' Cur Min Max Avg\\n'"; $rrd_options .= " DEF:SD=" . $rrd_filename . ":PacketLossSD:AVERAGE "; - $rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; - $rrd_options .= " GPRINT:SD:LAST:%3.0lf "; - $rrd_options .= " GPRINT:SD:MIN:%3.0lf "; - $rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst (ms) ' "; + $rrd_options .= " GPRINT:SD:LAST:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:MIN:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:MAX:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:AVERAGE:'%5.2lf'\\\l "; $rrd_options .= " DEF:DS=" . $rrd_filename . ":PacketLossDS:AVERAGE "; - $rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; - $rrd_options .= " GPRINT:DS:LAST:%3.0lf "; - $rrd_options .= " GPRINT:DS:MIN:%3.0lf "; - $rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:DS#008C00:'Dst to Src (ms) ' "; + $rrd_options .= " GPRINT:DS:LAST:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:MIN:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:MAX:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:AVERAGE:'%5.2lf'\\\l "; } diff --git a/html/includes/graphs/device/sla_jitter-lost.inc.php b/html/includes/graphs/device/sla_jitter-lost.inc.php index 82e550d84e95..688aea2e2d50 100644 --- a/html/includes/graphs/device/sla_jitter-lost.inc.php +++ b/html/includes/graphs/device/sla_jitter-lost.inc.php @@ -18,23 +18,26 @@ $rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); if (file_exists($rrd_filename)) { - $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " COMMENT:' Cur Min Max Avg\\n'"; $rrd_options .= " DEF:POS=" . $rrd_filename . ":PacketOutOfSequence:AVERAGE "; - $rrd_options .= " LINE1.25:POS#0000ee:'Out of Sequence ' "; + $rrd_options .= " LINE1.25:POS#0000ee:'Out of Sequence ' "; $rrd_options .= " GPRINT:POS:LAST:%3.0lf "; $rrd_options .= " GPRINT:POS:MIN:%3.0lf "; - $rrd_options .= " GPRINT:POS:MAX:%3.0lf\\\l "; + $rrd_options .= " GPRINT:POS:MAX:%3.0lf "; + $rrd_options .= " GPRINT:POS:AVERAGE:'%3.0lf'\\\l "; $rrd_options .= " DEF:MIA=" . $rrd_filename . ":PacketMIA:AVERAGE "; - $rrd_options .= " LINE1.25:MIA#008C00:'Missing in Action ' "; + $rrd_options .= " LINE1.25:MIA#008C00:'Missing in Action ' "; $rrd_options .= " GPRINT:MIA:LAST:%3.0lf "; $rrd_options .= " GPRINT:MIA:MIN:%3.0lf "; - $rrd_options .= " GPRINT:MIA:MAX:%3.0lf\\\l "; + $rrd_options .= " GPRINT:MIA:MAX:%3.0lf "; + $rrd_options .= " GPRINT:MIA:AVERAGE:'%3.0lf'\\\l "; $rrd_options .= " DEF:PLA=" . $rrd_filename . ":PacketLateArrival:AVERAGE "; - $rrd_options .= " LINE1.25:PLA#CC0000:'Late Arrival ' "; + $rrd_options .= " LINE1.25:PLA#CC0000:'Late Arrival ' "; $rrd_options .= " GPRINT:PLA:LAST:%3.0lf "; $rrd_options .= " GPRINT:PLA:MIN:%3.0lf "; - $rrd_options .= " GPRINT:PLA:MAX:%3.0lf\\\l "; + $rrd_options .= " GPRINT:PLA:MAX:%3.0lf "; + $rrd_options .= " GPRINT:PLA:AVERAGE:'%3.0lf'\\\l "; } diff --git a/html/includes/graphs/device/sla_jitter-mos.inc.php b/html/includes/graphs/device/sla_jitter-mos.inc.php index 2b743a495fad..b42c7e345ba9 100644 --- a/html/includes/graphs/device/sla_jitter-mos.inc.php +++ b/html/includes/graphs/device/sla_jitter-mos.inc.php @@ -18,11 +18,12 @@ $rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); if (file_exists($rrd_filename)) { - $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " COMMENT:' Cur Min Max Avg\\n'"; $rrd_options .= " DEF:MOS=" . $rrd_filename . ":MOS:AVERAGE "; - $rrd_options .= " LINE1.25:MOS#0000ee:'Mean Opinion Score ' "; - $rrd_options .= " GPRINT:MOS:LAST:%3.0lf "; - $rrd_options .= " GPRINT:MOS:MIN:%3.0lf "; - $rrd_options .= " GPRINT:MOS:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:MOS#0000ee:'Mean Opinion Score ' "; + $rrd_options .= " GPRINT:MOS:LAST:%3.2lf "; + $rrd_options .= " GPRINT:MOS:MIN:%3.2lf "; + $rrd_options .= " GPRINT:MOS:MAX:%3.2lf "; + $rrd_options .= " GPRINT:MOS:AVERAGE:'%3.2lf'\\\l "; } diff --git a/html/includes/graphs/device/sla_jitter.inc.php b/html/includes/graphs/device/sla_jitter.inc.php index 2abe1507c6ad..d054fa2396ab 100644 --- a/html/includes/graphs/device/sla_jitter.inc.php +++ b/html/includes/graphs/device/sla_jitter.inc.php @@ -18,17 +18,19 @@ $rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); if (file_exists($rrd_filename)) { - $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " COMMENT:' Cur Min Max Avg\\n'"; $rrd_options .= " DEF:SD=" . $rrd_filename . ":AvgSDJ:AVERAGE "; - $rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; - $rrd_options .= " GPRINT:SD:LAST:%3.0lf "; - $rrd_options .= " GPRINT:SD:MIN:%3.0lf "; - $rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst (ms) ' "; + $rrd_options .= " GPRINT:SD:LAST:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:MIN:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:MAX:'%5.2lf' "; + $rrd_options .= " GPRINT:SD:AVERAGE:'%5.2lf'\\\l "; $rrd_options .= " DEF:DS=" . $rrd_filename . ":AvgDSJ:AVERAGE "; - $rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; - $rrd_options .= " GPRINT:DS:LAST:%3.0lf "; - $rrd_options .= " GPRINT:DS:MIN:%3.0lf "; - $rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; + $rrd_options .= " LINE1.25:DS#008C00:'Dst to Src (ms) ' "; + $rrd_options .= " GPRINT:DS:LAST:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:MIN:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:MAX:'%5.2lf' "; + $rrd_options .= " GPRINT:DS:AVERAGE:'%5.2lf'\\\l "; }