garage_db: rename len to approximate_len as it is used for stats only

This commit is contained in:
Alex Auvolat
2025-08-27 21:17:32 +02:00
parent a64b567d43
commit 90bba5889a
15 changed files with 69 additions and 44 deletions
+3 -3
View File
@@ -121,13 +121,13 @@ impl Worker for LifecycleWorker {
mpu_aborted,
..
} => {
let n_objects = self.garage.object_table.data.store.len().ok();
let n_objects = self.garage.object_table.data.store.approximate_len().ok();
let progress = match n_objects {
None => "...".to_string(),
Some(total) => format!(
Some(total) if total > 0 => format!(
"~{:.2}%",
100. * std::cmp::min(*counter, total) as f32 / total as f32
),
_ => "...".to_string(),
};
WorkerStatus {
progress: Some(progress),