New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Configurable 95th percentile #7442

Merged
merged 1 commit into from Oct 11, 2017
Jump to file or symbol
Failed to load files and symbols.
+78 −47
Diff settings

Always

Just for now

@@ -293,6 +293,11 @@ You can enable the old style network map (only available for individual devices
$config['gui']['network-map']['style'] = 'old';
```
```php
$config['percentile_value'] = X;
```
Show the `X`th percentile in the graph instead of the default 95th percentile.
### Add host settings
The following setting controls how hosts are added. If a host is added as an ip address it is checked to ensure the ip is not already present. If the ip is present the host is not added.
If host is added by hostname this check is not performed. If the setting is true hostnames are resolved and the check is also performed. This helps prevents accidental duplicate hosts.
@@ -73,30 +73,33 @@
$rrd_options .= ' CDEF:inbits=inoctets,8,*';
$rrd_options .= ' CDEF:inbits_max=inoctets_max,8,*';
if ($config['rrdgraph_real_95th']) {
if ($config['rrdgraph_real_percentile']) {
$rrd_options .= ' CDEF:highbits=inoctets,outoctets,MAX,8,*';
$rrd_options .= ' VDEF:95thhigh=highbits,95,PERCENT';
$rrd_options .= ' VDEF:percentilehigh=highbits,'.$config['percentile_value'].',PERCENT';
}
$rrd_options .= ' VDEF:totin=inoctets,TOTAL';
$rrd_options .= ' VDEF:totout=outoctets,TOTAL';
$rrd_options .= ' VDEF:tot=octets,TOTAL';
$rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST';
$rrd_options .= ' CDEF:dpercentile_outn=doutbits,-1,*';
$rrd_options .= ' VDEF:dpercentile_outnp=dpercentile_outn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_out=dpercentile_outnpn,FIRST';
if ($format == 'octets' || $format == 'bytes') {
$rrd_options .= ' VDEF:95thin=inoctets,95,PERCENT';
$rrd_options .= ' VDEF:95thout=outoctets,95,PERCENT';
$rrd_options .= ' VDEF:percentile_in=inoctets,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_out=outoctets,'.$config['percentile_value'].',PERCENT';
$units = 'Bps';
$format = 'octets';
} else {
$rrd_options .= ' VDEF:95thin=inbits,95,PERCENT';
$rrd_options .= ' VDEF:95thout=outbits,95,PERCENT';
$rrd_options .= ' VDEF:percentile_in=inbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_out=outbits,'.$config['percentile_value'].',PERCENT';
$units = 'bps';
$format = 'bits';
}
$rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
$rrd_options .= " COMMENT:'bps Now Ave Max ".$config['percentile_value']."th %\\n'";
$rrd_options .= ' AREA:in'.$format.'_max#D7FFC7:';
$rrd_options .= ' AREA:in'.$format.'#90B040:';
@@ -105,7 +108,7 @@
$rrd_options .= ' GPRINT:in'.$format.':LAST:%6.2lf%s';
$rrd_options .= ' GPRINT:in'.$format.':AVERAGE:%6.2lf%s';
$rrd_options .= ' GPRINT:in'.$format.'_max:MAX:%6.2lf%s';
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\n";
$rrd_options .= " GPRINT:percentile_in:%6.2lf%s\\n";
$rrd_options .= ' AREA:dout'.$format.'_max#E0E0FF:';
$rrd_options .= ' AREA:dout'.$format.'#8080C0:';
@@ -114,18 +117,18 @@
$rrd_options .= ' GPRINT:out'.$format.':LAST:%6.2lf%s';
$rrd_options .= ' GPRINT:out'.$format.':AVERAGE:%6.2lf%s';
$rrd_options .= ' GPRINT:out'.$format.'_max:MAX:%6.2lf%s';
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\n";
$rrd_options .= " GPRINT:percentile_out:%6.2lf%s\\n";
if ($config['rrdgraph_real_95th']) {
$rrd_options .= ' HRULE:95thhigh#FF0000:"Highest"';
$rrd_options .= " GPRINT:95thhigh:\"%30.2lf%s\\n\"";
if ($config['rrdgraph_real_percentile']) {
$rrd_options .= ' HRULE:percentilehigh#FF0000:"Highest"';
$rrd_options .= " GPRINT:percentilehigh:\"%30.2lf%s\\n\"";
}
$rrd_options .= " GPRINT:tot:'Total %6.2lf%sB'";
$rrd_options .= " GPRINT:totin:'(In %6.2lf%sB'";
$rrd_options .= " GPRINT:totout:'Out %6.2lf%sB)\\l'";
$rrd_options .= ' LINE1:95thin#aa0000';
$rrd_options .= ' LINE1:d95thout#aa0000';
$rrd_options .= ' LINE1:percentile_in#aa0000';
$rrd_options .= ' LINE1:dpercentile_out#aa0000';
if ($_GET['previous'] == 'yes') {
$rrd_options .= ' LINE1.25:in'.$format."X#009900:'Prev In \\\\n'";
@@ -53,9 +53,12 @@
$rrd_options .= ' CDEF:inbits=inoctets,8,*';
$rrd_options .= ' CDEF:outbits=outoctets,8,*';
$rrd_options .= ' CDEF:doutbits=doutoctets,8,*';
$rrd_options .= ' VDEF:95thin=inbits,95,PERCENT';
$rrd_options .= ' VDEF:95thout=outbits,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST';
$rrd_options .= ' VDEF:percentile_in=inbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_out=outbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outn=doutbits,-1,*';
$rrd_options .= ' VDEF:dpercentile_outnp=dpercentile_outn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_out=dpercentile_outnpn,FIRST';
if ($_GET['previous'] == 'yes') {
$rrd_options .= ' CDEF:'.$in.'octetsX='.$in_thingX.$pluses;
@@ -64,9 +67,12 @@
$rrd_options .= ' CDEF:inbitsX=inoctetsX,8,*';
$rrd_options .= ' CDEF:outbitsX=outoctetsX,8,*';
$rrd_options .= ' CDEF:doutbitsX=doutoctetsX,8,*';
$rrd_options .= ' VDEF:95thinX=inbitsX,95,PERCENT';
$rrd_options .= ' VDEF:95thoutX=outbitsX,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutXn=doutbitsX,-1,* VDEF:d95thoutXn95=d95thoutXn,95,PERCENT CDEF:d95thoutXn95n=doutbitsX,doutbitsX,-,d95thoutXn95,-1,*,+ VDEF:d95thoutX=d95thoutXn95n,FIRST';
$rrd_options .= ' VDEF:percentile_inX=inbitsX,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_outX=outbitsX,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outXn=doutbitsX,-1,*';
$rrd_options .= ' VDEF:dpercentile_outX=dpercentile_outXn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outXn=doutbitsX,doutbitsX,-,dpercentile_outX,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_outX=dpercentile_outXn,FIRST';
}
if ($legend == 'no' || $legend == '1') {
@@ -76,22 +82,22 @@
$rrd_options .= ' LINE1.25:doutbits#'.$colour_line_out.':';
} else {
$rrd_options .= ' AREA:inbits#'.$colour_area_in.':';
$rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
$rrd_options .= " COMMENT:'bps Now Ave Max ".$config['percentile_value']."th %\\n'";
$rrd_options .= ' LINE1.25:inbits#'.$colour_line_in.':In\ ';
$rrd_options .= ' GPRINT:inbits:LAST:%6.2lf%s';
$rrd_options .= ' GPRINT:inbits:AVERAGE:%6.2lf%s';
$rrd_options .= ' GPRINT:inbits:MAX:%6.2lf%s';
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\\\n";
$rrd_options .= " GPRINT:percentile_in:%6.2lf%s\\\\n";
$rrd_options .= ' AREA:doutbits#'.$colour_area_out.':';
$rrd_options .= ' LINE1.25:doutbits#'.$colour_line_out.':Out';
$rrd_options .= ' GPRINT:outbits:LAST:%6.2lf%s';
$rrd_options .= ' GPRINT:outbits:AVERAGE:%6.2lf%s';
$rrd_options .= ' GPRINT:outbits:MAX:%6.2lf%s';
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\\\n";
$rrd_options .= " GPRINT:percentile_out:%6.2lf%s\\\\n";
}
$rrd_options .= ' LINE1:95thin#aa0000';
$rrd_options .= ' LINE1:d95thout#aa0000';
$rrd_options .= ' LINE1:percentile_in#aa0000';
$rrd_options .= ' LINE1:dpercentile_out#aa0000';
if ($_GET['previous'] == 'yes') {
$rrd_options .= ' AREA:inbitsX#9999966:';
@@ -61,9 +61,12 @@
$rrd_options .= ' CDEF:inbits=inoctets,8,*';
$rrd_options .= ' CDEF:outbits=outoctets,8,*';
$rrd_options .= ' CDEF:doutbits=doutoctets,8,*';
$rrd_options .= ' VDEF:95thin=inbits,95,PERCENT';
$rrd_options .= ' VDEF:95thout=outbits,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST';
$rrd_options .= ' VDEF:percentile_in=inbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_out=outbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outn=doutbits,-1,*';
$rrd_options .= ' VDEF:dpercentile_outp=dpercentile_outn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outpn=doutbits,doutbits,-,dpercentile_outp,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_out=dpercentile_outpn,FIRST';
if ($_GET['previous'] == 'yes') {
$rrd_options .= ' CDEF:'.$in.'octetsX='.$in_thingX.$pluses;
@@ -72,9 +75,12 @@
$rrd_options .= ' CDEF:inbitsX=inoctetsX,8,*';
$rrd_options .= ' CDEF:outbitsX=outoctetsX,8,*';
$rrd_options .= ' CDEF:doutbitsX=doutoctetsX,8,*';
$rrd_options .= ' VDEF:95thinX=inbitsX,95,PERCENT';
$rrd_options .= ' VDEF:95thoutX=outbitsX,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutXn=doutbitsX,-1,* VDEF:d95thoutXn95=d95thoutXn,95,PERCENT CDEF:d95thoutXn95n=doutbitsX,doutbitsX,-,d95thoutXn95,-1,*,+ VDEF:d95thoutX=d95thoutXn95n,FIRST';
$rrd_options .= ' VDEF:percentile_inX=inbitsX,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_outX=outbitsX,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outXn=doutbitsX,-1,*';
$rrd_options .= ' VDEF:dpercentile_outX=dpercentile_outXn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outXn=doutbitsX,doutbitsX,-,dpercentile_outX,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_outX=dpercentile_outXn,FIRST';
}
if ($legend == 'no' || $legend == '1') {
@@ -83,23 +89,23 @@
$rrd_options .= ' AREA:dout'.$format.'#'.$colour_area_out.':';
// $rrd_options .= " LINE1.25:dout".$format."#".$colour_line_out.":";
} else {
$rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
$rrd_options .= " COMMENT:'bps Now Ave Max ".$config['percentile_value']."th %\\n'";
$rrd_options .= ' AREA:in'.$format.'#'.$colour_area_in.':In ';
// $rrd_options .= " LINE1.25:in".$format."#".$colour_line_in.":In\ ";
$rrd_options .= ' GPRINT:in'.$format.':LAST:%6.2lf%s';
$rrd_options .= ' GPRINT:in'.$format.':AVERAGE:%6.2lf%s';
$rrd_options .= ' GPRINT:in'.$format.':MAX:%6.2lf%s';
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\\\n";
$rrd_options .= " GPRINT:percentile_in:%6.2lf%s\\\\n";
$rrd_options .= ' AREA:dout'.$format.'#'.$colour_area_out.':Out';
// $rrd_options .= " LINE1.25:dout".$format."#".$colour_line_out.":Out";
$rrd_options .= ' GPRINT:out'.$format.':LAST:%6.2lf%s';
$rrd_options .= ' GPRINT:out'.$format.':AVERAGE:%6.2lf%s';
$rrd_options .= ' GPRINT:out'.$format.':MAX:%6.2lf%s';
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\\\n";
$rrd_options .= " GPRINT:percentile_out:%6.2lf%s\\\\n";
}
$rrd_options .= ' LINE1:95thin#aa0000';
$rrd_options .= ' LINE1:d95thout#aa0000';
$rrd_options .= ' LINE1:percentile_in#aa0000';
$rrd_options .= ' LINE1:dpercentile_out#aa0000';
if ($_GET['previous'] == 'yes') {
$rrd_options .= ' AREA:in'.$format.'X#99999999:';
@@ -103,9 +103,9 @@
$rrd_options .= ' CDEF:outbits=outoctets,8,*';
$rrd_options .= ' CDEF:doutbits=doutoctets,8,*';
$rrd_options .= ' VDEF:95thin=inbits,95,PERCENT';
$rrd_options .= ' VDEF:95thout=outbits,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST';
$rrd_options .= ' VDEF:percentile_in=inbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_out=outbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outn=doutbits,-1,* VDEF:dpercentile_outnp=dpercentile_outn,'.$config['percentile_value'].',PERCENT CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+ VDEF:dpercentile_out=dpercentile_outnpn,FIRST';
$rrd_options .= ' VDEF:totin=inoctets,TOTAL';
$rrd_options .= ' VDEF:totout=outoctets,TOTAL';
@@ -108,9 +108,12 @@
$rrd_options .= ' CDEF:outbitsX=outBX,8,*';
$rrd_options .= ' CDEF:bitsX=inbitsX,outbitsX,+';
$rrd_options .= ' CDEF:doutbitsX=doutBX,8,*';
$rrd_options .= ' VDEF:95thinX=inbitsX,95,PERCENT';
$rrd_options .= ' VDEF:95thoutX=outbitsX,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutXn=doutbitsX,-1,* VDEF:d95thoutXn95=d95thoutXn,95,PERCENT CDEF:d95thoutXn95n=doutbitsX,doutbitsX,-,d95thoutXn95,-1,*,+ VDEF:d95thoutX=d95thoutXn95n,FIRST';
$rrd_options .= ' VDEF:percentile_inX=inbitsX,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_outX=outbitsX,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outXn=doutbitsX,-1,*';
$rrd_options .= ' VDEF:dpercentile_outX=dpercentile_outXn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outXn=doutbitsX,doutbitsX,-,dpercentile_outX,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_outX=dpercentile_outXn,FIRST';
}
if ($_GET['previous'] == 'yes') {
@@ -129,9 +132,12 @@
$rrd_options .= ' CDEF:outbits=outB,8,*';
$rrd_options .= ' CDEF:bits=inbits,outbits,+';
$rrd_options .= ' CDEF:doutbits=doutB,8,*';
$rrd_options .= ' VDEF:95thin=inbits,95,PERCENT';
$rrd_options .= ' VDEF:95thout=outbits,95,PERCENT';
$rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST';
$rrd_options .= ' VDEF:percentile_in=inbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' VDEF:percentile_out=outbits,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outn=doutbits,-1,*';
$rrd_options .= ' VDEF:dpercentile_outnp=dpercentile_outn,'.$config['percentile_value'].',PERCENT';
$rrd_options .= ' CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+';
$rrd_options .= ' VDEF:dpercentile_out=dpercentile_outnpn,FIRST';
$rrd_options .= ' VDEF:totin=inB,TOTAL';
$rrd_options .= ' VDEF:avein=inbits,AVERAGE';
$rrd_options .= ' VDEF:totout=outB,TOTAL';
@@ -231,7 +231,8 @@
// Cosmetics
$config['rrdgraph_def_text'] = '-c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5';
$config['rrdgraph_def_text'] .= ' -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal';
$config['rrdgraph_real_95th'] = false;
$config['rrdgraph_real_percentile'] = false;
$config['percentile_value'] = 95;
// Set to TRUE if you want to display the 95% based on the highest value. (aka real 95%)
$config['overlib_defaults'] = ",FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e'";
$config['web_mouseover'] = true;
@@ -38,3 +38,7 @@
if ($config['secure_cookies']) {
ini_set('session.cookie_secure', 1);
}
if ($config['rrdgraph_real_95th']) {
$config['rrdgraph_real_percentile'] = $config['rrdgraph_real_95th'];
}
ProTip! Use n and p to navigate between commits in a pull request.