From: Michael Tremer Date: Thu, 2 Oct 2025 19:25:18 +0000 (+0000) Subject: graph: Allow to specify the output format X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a24747aef601477dd22be0b1525bad2a07b84fd;p=telemetry.git graph: Allow to specify the output format Signed-off-by: Michael Tremer --- diff --git a/src/daemon/graph.c b/src/daemon/graph.c index 5da89e2..87fe204 100644 --- a/src/daemon/graph.c +++ b/src/daemon/graph.c @@ -203,6 +203,13 @@ int collecty_graph_render(collecty_graph* self, const char* object, if (r < 0) goto ERROR; + // Select the output format + if (options->format) { + r = collecty_args_push(args, "--imgformat=%s", options->format); + if (r < 0) + goto ERROR; + } + // Write the graph to the output stream r = collecty_args_push(args, "-"); if (r < 0) diff --git a/src/daemon/graph.h b/src/daemon/graph.h index 968e48c..043ad66 100644 --- a/src/daemon/graph.h +++ b/src/daemon/graph.h @@ -52,7 +52,7 @@ int collecty_graph_require_module(collecty_graph* self, collecty_args* args, const char* name, const char* object); typedef struct collecty_graph_render_options { - // XXX TODO + const char* format; } collecty_graph_render_options; int collecty_graph_render(collecty_graph* self, const char* object,