From: Michael Tremer Date: Thu, 30 Oct 2025 14:57:47 +0000 (+0000) Subject: source: Fix the step/heartbeat maths X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c1f099cc3ab29992d1e8ad7157c6d629040c01d;p=telemetry.git source: Fix the step/heartbeat maths Signed-off-by: Michael Tremer --- diff --git a/src/daemon/source.c b/src/daemon/source.c index 3a5f6a9..6025dfe 100644 --- a/src/daemon/source.c +++ b/src/daemon/source.c @@ -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());