3434use LibreNMS \Data \Graphing \AbstractGraph ;
3535use LibreNMS \Data \Graphing \Builders \MultiLineGraphBuilder ;
3636use LibreNMS \Data \Graphing \Builders \MultiSimplexSeparatedGraphBuilder ;
37+ use LibreNMS \Data \Graphing \GraphParameters ;
3738
3839class ProcessorGraph extends AbstractGraph
3940{
@@ -73,14 +74,12 @@ public function getRrdFiles(): array
7374 return $ files ;
7475 }
7576
76- public function definition (array $ vars = [] ): array
77+ public function definition (GraphParameters $ graph_params ): array
7778 {
7879 if ($ this ->processors ->isEmpty ()) {
7980 throw new \LibreNMS \Exceptions \RrdGraphException ('No Processors ' );
8081 }
8182
82- $ vars = array_merge ($ this ->vars , $ vars );
83-
8483 // Filter valid datasets and run checkRrdExists exactly once per processor
8584 $ valid_datasets = [];
8685 foreach ($ this ->processors as $ proc ) {
@@ -111,7 +110,7 @@ public function definition(array $vars = []): array
111110 $ builder ->addDataset ($ dataset ['filename ' ], 'usage ' , $ dataset ['descr ' ]);
112111 }
113112
114- return $ builder ->build ($ vars );
113+ return $ builder ->build ($ graph_params );
115114 }
116115
117116 $ builder = (new MultiLineGraphBuilder ())
@@ -127,6 +126,6 @@ public function definition(array $vars = []): array
127126 $ builder ->addDataset ($ dataset ['filename ' ], 'usage ' , $ dataset ['descr ' ], area: true );
128127 }
129128
130- return $ builder ->build ($ vars );
129+ return $ builder ->build ($ graph_params );
131130 }
132131}
0 commit comments