]> git.ipfire.org Git - oddments/collecty.git/commitdiff
source: Fix the step/heartbeat maths
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Oct 2025 14:57:47 +0000 (14:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Oct 2025 14:57:47 +0000 (14:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/source.c

index 3a5f6a93e7d02a1fbd6d57e5a28a3f36f5bdda37..6025dfed77c7956bc5f9071e4256631db779db77 100644 (file)
@@ -602,7 +602,7 @@ static int td_source_create_database(td_source* self, const char* path, const ch
 
                // Add the DS line
                r = td_args_push(args, "DS:%s:%s:%lu:%s:%s",
-                               ds->field, ds->type, USEC_TO_SEC(HEARTBEAT), min, max);
+                               ds->field, ds->type, USEC_TO_SEC(HEARTBEAT * 2), min, max);
                if (r < 0)
                        goto ERROR;
        }
@@ -627,7 +627,7 @@ static int td_source_create_database(td_source* self, const char* path, const ch
                goto ERROR;
 
        // Create the RRD file
-       r = rrd_create_r2(path, USEC_TO_SEC(HEARTBEAT / 2), 0, 0, sources, NULL,
+       r = rrd_create_r2(path, USEC_TO_SEC(HEARTBEAT), 0, 0, sources, NULL,
                        td_args_argc(args), td_args_argv(args));
        if (r < 0) {
                ERROR(self->ctx, "Failed to create %s: %s\n", path, rrd_get_error());