Rrd graph optimizations (#12806)

* RRD Graph optimization
Do not use temporary files to generate graphs
Don't start up a process to pipe commands to, just run the command
Error image improvements

* fix style issues

* run the rrdgraph command in the rrd directory
This commit is contained in:
Tony Murray
2021-05-03 09:48:15 -05:00
committed by GitHub
parent 21b0e20343
commit bb39b4ad83
7 changed files with 165 additions and 105 deletions
+3 -4
View File
@@ -81,8 +81,7 @@ function api_get_graph(array $vars)
{
global $dur; // Needed for callback within graph code
$auth = '1';
$base64_output = '';
$auth = true;
// prevent ugly error for undefined graphs from being passed to the user
[$type, $subtype] = extract_graph_type($vars['type']);
@@ -99,10 +98,10 @@ function api_get_graph(array $vars)
ob_end_clean();
if ($vars['output'] === 'base64') {
return api_success(['image' => $base64_output, 'content-type' => get_image_type()], 'image');
return api_success(['image' => $image, 'content-type' => get_image_type(Config::get('webui.graph_type'))], 'image');
}
return response($image, 200, ['Content-Type' => get_image_type()]);
return response($image, 200, ['Content-Type' => get_image_type(Config::get('webui.graph_type'))]);
}
function check_bill_permission($bill_id, $callback)