]> git.ipfire.org Git - telemetry.git/commitdiff
legacy-gateway-latency4: Store all times in seconds
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Nov 2025 17:46:24 +0000 (17:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Nov 2025 17:46:24 +0000 (17:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/sources/legacy-gateway-latency4.c

index c799425434d2bdefd4c62baa6a66c4cadf4c2449..26cc995a4c9ec5cd86a7548a29d9265af781e506 100644 (file)
@@ -31,6 +31,7 @@
 #include "../command.h"
 #include "../ctx.h"
 #include "../source.h"
+#include "../time.h"
 #include "legacy-gateway-latency4.h"
 
 static int fetch_default_gateway(td_ctx* ctx,
@@ -156,6 +157,10 @@ static int legacy_gateway_latency_on_success(td_ctx* ctx,
        if (r < 0)
                return r;
 
+       // Convert the latency and standard deviation to seconds
+       avg  = MSEC_TO_SEC(avg);
+       mdev = MSEC_TO_SEC(mdev);
+
        // Convert the loss
        loss /= 100.0;