From: Michael Tremer Date: Sun, 28 Sep 2025 09:48:33 +0000 (+0000) Subject: module: Add the step size to the RRD configuration X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08e4597a4ad2386230b88c6dc99a6a40babb0add;p=collecty.git module: Add the step size to the RRD configuration Signed-off-by: Michael Tremer --- diff --git a/src/daemon/module.c b/src/daemon/module.c index 2414e80..e1da923 100644 --- a/src/daemon/module.c +++ b/src/daemon/module.c @@ -35,8 +35,10 @@ #include "module.h" #include "util.h" +#define STEPSIZE 60 // seconds + // Interval after which the heartbeat function is being called again -#define HEARTBEAT 60000000 // 60s +#define HEARTBEAT (STEPSIZE * 1000000) // usecs struct collecty_module { collecty_ctx* ctx; @@ -284,6 +286,11 @@ static int collecty_module_create_database(collecty_module* self, const char* pa if (r < 0) goto ERROR; + // Add the step size + r = collecty_args_push(args, "--step=%d", STEPSIZE); + if (r < 0) + goto ERROR; + // Add all data sources for (const collecty_rrd_ds* ds = self->methods->rrd_dss; ds->field; ds++) { // Format the minimum value