]> git.ipfire.org Git - collecty.git/commitdiff
module: Add the step size to the RRD configuration
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Sep 2025 09:48:33 +0000 (09:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Sep 2025 09:48:33 +0000 (09:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/module.c

index 2414e8074c7ad5c45ac0109977baa85b920eb432..e1da92334cc2174a7b915d0cf631882e913191a8 100644 (file)
 #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