From c562d8b0abb0b05aa924b441fc081d64c1d809bb Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 10 Jan 2025 18:38:13 +0100 Subject: [PATCH] Round memory test to nearest megabyte --- crates/store/re_chunk_store/tests/memory_test.rs | 4 ++-- .../snapshots/memory_test__scalars_on_one_timeline_new.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/store/re_chunk_store/tests/memory_test.rs b/crates/store/re_chunk_store/tests/memory_test.rs index 9af9d5c04ca6..96abe0c5f2b7 100644 --- a/crates/store/re_chunk_store/tests/memory_test.rs +++ b/crates/store/re_chunk_store/tests/memory_test.rs @@ -135,8 +135,8 @@ fn scalar_memory_overhead() { [ format!("{NUM_SCALARS} scalars"), format!( - "{} in total", - re_format::format_bytes(total_mem_use_global as _) + "{} MiB in total", + (total_mem_use_global as f64 / 1024.0 / 1024.0).round() // Round to nearest megabyte - we get fluctuations on the kB depending on platform ), format!( "{} per row", diff --git a/crates/store/re_chunk_store/tests/snapshots/memory_test__scalars_on_one_timeline_new.snap b/crates/store/re_chunk_store/tests/snapshots/memory_test__scalars_on_one_timeline_new.snap index 24c8f120f53f..6d2e21bbc212 100644 --- a/crates/store/re_chunk_store/tests/snapshots/memory_test__scalars_on_one_timeline_new.snap +++ b/crates/store/re_chunk_store/tests/snapshots/memory_test__scalars_on_one_timeline_new.snap @@ -1,11 +1,11 @@ --- source: crates/store/re_chunk_store/tests/memory_test.rs assertion_line: 133 -expression: "[format!(\"{NUM_SCALARS} scalars\"),\nformat!(\"{} in total\", re_format::format_bytes(total_mem_use_global as _)),\nformat!(\"{} per row\",\nre_format::format_bytes(total_mem_use_global as f64 / NUM_SCALARS as f64)),]" +expression: "[format!(\"{NUM_SCALARS} scalars\"),\nformat!(\"{} MiB in total\",\n(total_mem_use_global as f64 / 1024.0 / 1024.0).round()),\nformat!(\"{} per row\",\nre_format::format_bytes(total_mem_use_global as f64 / NUM_SCALARS as f64)),]" snapshot_kind: text --- [ "1048576 scalars", - "37.0 MiB in total", + "37 MiB in total", "37 B per row", ]