Skip to content

Commit

Permalink
Template: Fix multi template graphs
Browse files Browse the repository at this point in the history
The Bug:
It was not possible to create graphs with multi3 template graphs if different metrics or different numbers of metrics were given per graph.

Example (with 3 graphs):

graph 1: value, min, max, crit, warning
graph 2: value, crit, max, warning
graph 3: value, min
  • Loading branch information
sukhwinder33445 committed Apr 9, 2024
1 parent d844ba7 commit 8004d4c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions library/Graphite/Graphing/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,13 @@ protected function combineMetrics(

$allowedNextCurveMetricsPerCurrentCurveName = [];
foreach ($currentCombination as $currentCurveName => $currentCurveMetric) {
$allowedNextCurveMetricsPerCurrentCurveName[$currentCurveName]
= $possibleCombinations[$currentCurveName][$nextCurveName][$currentCurveMetric];
if (isset($possibleCombinations[$currentCurveName][$nextCurveName][$currentCurveMetric])) {
$allowedNextCurveMetricsPerCurrentCurveName[$currentCurveName]
= $possibleCombinations[$currentCurveName][$nextCurveName][$currentCurveMetric];
} else {
$metricsCombinations[] = $currentCombination;
return;
}
}

$allowedNextCurveMetrics = $allowedNextCurveMetricsPerCurrentCurveName[$currentCurveName];
Expand Down

0 comments on commit 8004d4c

Please sign in to comment.