]> git.ipfire.org Git - telemetry.git/commitdiff
graph: Allow to specify the output format
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Oct 2025 19:25:18 +0000 (19:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Oct 2025 19:25:18 +0000 (19:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/graph.c
src/daemon/graph.h

index 5da89e23729a212c44d0fe8756570ebad04154c2..87fe204a0345358fb527218ccb7e88f7e48186a1 100644 (file)
@@ -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)
index 968e48c9ab21da0bd92bc941bcbadd94463f36c2..043ad66600fd2537c42ee2f0495e1f1a63032a10 100644 (file)
@@ -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,