add graph_stat_percentile_disable config item to disable percentile lines/value printing (#14887)

* add the initial config items for graph_stat_percentile_disable

* update generic stats to use graph_stat_percentile_disable

* style fix
This commit is contained in:
Zane C. Bowers-Hadley
2023-03-09 10:24:32 -06:00
committed by GitHub
parent b2574196ef
commit cd82c72190
4 changed files with 25 additions and 6 deletions

View File

@@ -98,6 +98,8 @@ if (! isset($colour1w)) {
$iter++;
}
$graph_stat_percentile_disable = \LibreNMS\Config::get('graph_stat_percentile_disable');
$descr = \LibreNMS\Data\Store\Rrd::fixedSafeDescr($descr, $descr_len);
if ($height > 25) {
@@ -155,14 +157,16 @@ if ($height > 25) {
$rrd_optionsb .= ' GPRINT:' . $id . '1w:MAX:%5.' . $float_precision . 'lf%s' . $units . ' GPRINT:' . $id . "1w:AVERAGE:'%5." . $float_precision . "lf%s$units\\n'";
}
$rrd_optionsb .= ' HRULE:' . $id . '25th#' . $colour25th . ':25th_Percentile';
$rrd_optionsb .= ' GPRINT:' . $id . '25th:%' . $float_precision . 'lf%s\n';
if (! $graph_stat_percentile_disable) {
$rrd_optionsb .= ' HRULE:' . $id . '25th#' . $colour25th . ':25th_Percentile';
$rrd_optionsb .= ' GPRINT:' . $id . '25th:%' . $float_precision . 'lf%s\n';
$rrd_optionsb .= ' HRULE:' . $id . '50th#' . $colour50th . ':50th_Percentile';
$rrd_optionsb .= ' GPRINT:' . $id . '50th:%' . $float_precision . 'lf%s\n';
$rrd_optionsb .= ' HRULE:' . $id . '50th#' . $colour50th . ':50th_Percentile';
$rrd_optionsb .= ' GPRINT:' . $id . '50th:%' . $float_precision . 'lf%s\n';
$rrd_optionsb .= ' HRULE:' . $id . '75th#' . $colour75th . ':75th_Percentile';
$rrd_optionsb .= ' GPRINT:' . $id . '75th:%' . $float_precision . 'lf%s\n';
$rrd_optionsb .= ' HRULE:' . $id . '75th#' . $colour75th . ':75th_Percentile';
$rrd_optionsb .= ' GPRINT:' . $id . '75th:%' . $float_precision . 'lf%s\n';
}
}
$rrd_options .= $rrd_optionsb;
$rrd_options .= ' HRULE:0#555555';

View File

@@ -1776,6 +1776,13 @@
"default": null,
"type": "array"
},
"graph_stat_percentile_disable": {
"default": false,
"group": "webui",
"section": "graph",
"order": 7,
"type": "boolean"
},
"graph_colours.blues": {
"default": [
"A9A9F2",

View File

@@ -1580,6 +1580,10 @@ return [
'description' => 'Set the minimum graph height',
'help' => 'Minimum Graph Height (default: 300)',
],
'graph_stat_percentile_disable' => [
'description' => 'Disable Percentile for stats graphs globally',
'help' => 'Disables display of the percentile values and lines for graphs that display those',
],
],
'device_display_default' => [
'description' => 'Default device display name template',

View File

@@ -1547,6 +1547,10 @@ return [
'description' => 'Set the minimum graph height',
'help' => 'Minimum Graph Height (default: 300)',
],
'graph_stat_percentile_disable' => [
'description' => 'Disable Percentile for stats graphs globally',
'help' => 'Disables display of the percentile values and lines for graphs that display those',
],
],
'device_display_default' => [
'description' => 'Default device display name template',