From: Michael Tremer Date: Wed, 29 Oct 2025 14:45:55 +0000 (+0000) Subject: graphs: Implement adjusting the interval X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf37396bda821a64dbccd08a504290c0d69f4537;p=telemetry.git graphs: Implement adjusting the interval Signed-off-by: Michael Tremer --- diff --git a/src/daemon/graph.c b/src/daemon/graph.c index 0d39924..53d2e4a 100644 --- a/src/daemon/graph.c +++ b/src/daemon/graph.c @@ -284,6 +284,20 @@ int td_graph_render(td_graph* self, const char* object, goto ERROR; } + // Pass the start time + if (options->interval.t_start) { + r = td_args_push(args, "--start=%ld", options->interval.t_start); + if (r < 0) + goto ERROR; + } + + // Pass the end time + if (options->interval.t_end) { + r = td_args_push(args, "--end=%ld", options->interval.t_end); + if (r < 0) + goto ERROR; + } + // Set the title if (self->impl->title) { // Fetch the title diff --git a/src/daemon/graph.h b/src/daemon/graph.h index 6e27707..89e6319 100644 --- a/src/daemon/graph.h +++ b/src/daemon/graph.h @@ -78,6 +78,12 @@ typedef struct td_graph_render_options { unsigned int h; unsigned int w; } dimensions; + + // Interval + struct { + time_t t_start; + time_t t_end; + } interval; } td_graph_render_options; int td_graph_render(td_graph* self, const char* object,