Skip to content

Commit cc8690f

Browse files
martialblognilmerg
authored andcommitted
Shift graph_debug URL parameter in graphs overview
- This also adds the InternalProcessTracker to all the graphs in the overview
1 parent f3252bb commit cc8690f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

application/controllers/HostsController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Icinga\Module\Graphite\Controllers;
66

77
use GuzzleHttp\Psr7\ServerRequest;
8+
use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT;
89
use Icinga\Module\Graphite\Web\Controller\IcingadbGraphiteController;
910
use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait;
1011
use Icinga\Module\Graphite\Web\Widget\IcingadbGraphs;
@@ -28,7 +29,13 @@ public function indexAction()
2829
}
2930

3031
// shift graph params to avoid exception
32+
$graphDebug = $this->params->shift('graph_debug');
3133
$graphRange = $this->params->shift('graph_range');
34+
35+
if ($graphDebug) {
36+
IPT::enable();
37+
}
38+
3239
$baseFilter = $graphRange ? Filter::equal('graph_range', $graphRange) : null;
3340
foreach ($this->preservedParams as $param) {
3441
$this->params->shift($param);

application/controllers/ServicesController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Icinga\Module\Graphite\Controllers;
44

55
use GuzzleHttp\Psr7\ServerRequest;
6+
use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT;
67
use Icinga\Module\Graphite\Web\Controller\IcingadbGraphiteController;
78
use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait;
89
use Icinga\Module\Graphite\Web\Widget\IcingadbGraphs;
@@ -26,7 +27,13 @@ public function indexAction()
2627
}
2728

2829
// shift graph params to avoid exception
30+
$graphDebug = $this->params->shift('graph_debug');
2931
$graphRange = $this->params->shift('graph_range');
32+
33+
if ($graphDebug) {
34+
IPT::enable();
35+
}
36+
3037
$baseFilter = $graphRange ? Filter::equal('graph_range', $graphRange) : null;
3138
foreach ($this->preservedParams as $param) {
3239
$this->params->shift($param);

0 commit comments

Comments
 (0)