From 731ede746b0ff28561c064ca1c470800cde96d35 Mon Sep 17 00:00:00 2001 From: Andrii Sultanov Date: Fri, 17 Jan 2025 14:18:32 +0000 Subject: [PATCH] CA-404591 - rrd: Do not lose precision when converting floats to strings lastupdate field in the XML RRD blob file, in particular, was getting truncated floats representing the number of seconds, which loses A LOT of precision, meaning RRDs could not be checked to have been produced with the 5-second frequency. Signed-off-by: Andrii Sultanov --- ocaml/libs/xapi-rrd/lib/rrd_utils.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml/libs/xapi-rrd/lib/rrd_utils.ml b/ocaml/libs/xapi-rrd/lib/rrd_utils.ml index aa959a042dd..ffa35939da0 100644 --- a/ocaml/libs/xapi-rrd/lib/rrd_utils.ml +++ b/ocaml/libs/xapi-rrd/lib/rrd_utils.ml @@ -69,7 +69,7 @@ let array_remove n a = let f_to_s f = match classify_float f with | FP_normal | FP_subnormal -> - Printf.sprintf "%0.5g" f + Printf.sprintf "%0.15g" f | FP_nan -> "NaN" | FP_infinite ->