mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix graph previous period getting partially applied (#14572)
This commit is contained in:
@@ -53,7 +53,7 @@ if ($multiplier) {
|
||||
$rrd_options .= ' DEF:' . $in . 'octets_max=' . $rrd_filename_in . ':' . $ds_in . ':MAX';
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
if ($multiplier) {
|
||||
$rrd_options .= ' DEF:p' . $out . 'octetsX=' . $rrd_filename_out . ':' . $ds_out . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' DEF:p' . $in . 'octetsX=' . $rrd_filename_in . ':' . $ds_in . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
@@ -105,7 +105,7 @@ $rrd_options .= ' CDEF:inbits_max=inoctets_max,8,*';
|
||||
if (Config::get('rrdgraph_real_percentile')) {
|
||||
$rrd_options .= ' CDEF:highbits=inoctets,outoctets,MAX,8,*';
|
||||
$rrd_options .= ' VDEF:percentilehigh=highbits,' . Config::get('percentile_value') . ',PERCENT';
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= ' CDEF:highbitsX=inoctetsX,outoctetsX,MAX,8,*';
|
||||
$rrd_options .= ' VDEF:percentilehighX=highbitsX,' . Config::get('percentile_value') . ',PERCENT';
|
||||
}
|
||||
@@ -122,7 +122,7 @@ $rrd_options .= ' VDEF:dpercentile_out=dpercentile_outnpn,FIRST';
|
||||
if ($format == 'octets' || $format == 'bytes') {
|
||||
$rrd_options .= ' VDEF:percentile_in=inoctets,' . Config::get('percentile_value') . ',PERCENT';
|
||||
$rrd_options .= ' VDEF:percentile_out=outoctets,' . Config::get('percentile_value') . ',PERCENT';
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= ' VDEF:percentile_inX=inoctetsX,' . Config::get('percentile_value') . ',PERCENT';
|
||||
$rrd_options .= ' VDEF:percentile_outX=outoctetsX,' . Config::get('percentile_value') . ',PERCENT';
|
||||
}
|
||||
@@ -131,7 +131,7 @@ if ($format == 'octets' || $format == 'bytes') {
|
||||
} else {
|
||||
$rrd_options .= ' VDEF:percentile_in=inbits,' . Config::get('percentile_value') . ',PERCENT';
|
||||
$rrd_options .= ' VDEF:percentile_out=outbits,' . Config::get('percentile_value') . ',PERCENT';
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= ' VDEF:percentile_inX=inbitsX,' . Config::get('percentile_value') . ',PERCENT';
|
||||
$rrd_options .= ' VDEF:percentile_outX=outbitsX,' . Config::get('percentile_value') . ',PERCENT';
|
||||
}
|
||||
@@ -186,7 +186,7 @@ if ($to > time()) {
|
||||
$rrd_options .= " LINE2:olsl#4400dd:'Out Linear Prediction\\n':dashes=8";
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= " COMMENT:' \\n'";
|
||||
$rrd_options .= ' LINE1.25:in' . $format . "X#333300:'Prev In '\t";
|
||||
$rrd_options .= ' GPRINT:in' . $format . 'X:AVERAGE:%6.' . $float_precision . 'lf%s';
|
||||
|
@@ -160,7 +160,7 @@ foreach ($rrd_list ?? [] as $rrd) {
|
||||
$rrd_options .= ' GPRINT:totinB' . $i . ':%6.' . $float_precision . "lf%s$total_units";
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= " COMMENT:' \t'";
|
||||
$rrd_options .= ' GPRINT:inbits' . $i . 'X:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:inbits' . $i . 'X:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
@@ -180,7 +180,7 @@ foreach ($rrd_list ?? [] as $rrd) {
|
||||
$rrd_options .= ' GPRINT:totoutB' . $i . ':%6.' . $float_precision . "lf%s$total_units";
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= " COMMENT:' \t'";
|
||||
$rrd_options .= ' GPRINT:outbits' . $i . 'X:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:outbits' . $i . 'X:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
@@ -194,7 +194,7 @@ foreach ($rrd_list ?? [] as $rrd) {
|
||||
$iter++;
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= ' CDEF:inBX=' . $in_thingX . $plusesX;
|
||||
$rrd_options .= ' CDEF:outBX=' . $out_thingX . $plusesX;
|
||||
$rrd_options .= ' CDEF:octetsX=inBX,outBX,+';
|
||||
@@ -216,7 +216,7 @@ if ($previous == 'yes') {
|
||||
$rrd_options .= ' VDEF:totX=octetsX,TOTAL';
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= ' AREA:in' . $format . 'X#99999999' . $stacked['transparency'] . ':';
|
||||
$rrd_optionsb .= ' AREA:dout' . $format . 'X#99999999' . $transparency . ':';
|
||||
$rrd_options .= ' LINE1.25:in' . $format . 'X#666666:';
|
||||
@@ -251,7 +251,7 @@ if (! $nototal) {
|
||||
$rrd_options .= ' GPRINT:inbits:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:inbits:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:totin:%6.' . $float_precision . "lf%s$total_units";
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= " COMMENT:' \t'";
|
||||
$rrd_options .= ' GPRINT:inbitsX:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:inbitsX:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
@@ -264,7 +264,7 @@ if (! $nototal) {
|
||||
$rrd_options .= ' GPRINT:outbits:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:outbits:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:totout:%6.' . $float_precision . "lf%s$total_units";
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= " COMMENT:' \t'";
|
||||
$rrd_options .= ' GPRINT:outbitsX:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:outbitsX:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
@@ -277,7 +277,7 @@ if (! $nototal) {
|
||||
$rrd_options .= ' GPRINT:bits:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:bits:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:tot:%6.' . $float_precision . "lf%s$total_units";
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= " COMMENT:' \t'";
|
||||
$rrd_options .= ' GPRINT:bitsX:AVERAGE:%6.' . $float_precision . "lf%s$units";
|
||||
$rrd_options .= ' GPRINT:bitsX:MAX:%6.' . $float_precision . "lf%s$units";
|
||||
|
@@ -111,7 +111,7 @@ foreach ($rrd_list as $i => $rrd) {
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
}//end foreach
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
if (is_numeric($multiplier)) {
|
||||
$rrd_options .= ' CDEF:X=' . $thingX . $plusesX . ',' . $multiplier . ',*';
|
||||
} elseif (is_numeric($divider)) {
|
||||
|
@@ -33,7 +33,7 @@ if ($percentile) {
|
||||
$rrd_options .= ' VDEF:' . $ds . '_percentile=' . $ds . ',' . $percentile . ',PERCENT';
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
if ($multiplier) {
|
||||
if (empty($multiplier_action)) {
|
||||
$multiplier_action = '*';
|
||||
@@ -90,7 +90,7 @@ if ($percentile) {
|
||||
$rrd_options .= ' LINE1:' . $ds . '_percentile#aa0000';
|
||||
}
|
||||
|
||||
if ($previous == 'yes') {
|
||||
if ($previous) {
|
||||
$rrd_options .= ' LINE1.25:' . $ds . "X#666666:'Prev \\n'";
|
||||
$rrd_options .= ' AREA:' . $ds . 'X#99999966:';
|
||||
}
|
||||
|
Reference in New Issue
Block a user