fix leveled compaction tests

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
This commit is contained in:
Alex Chi Z
2024-01-30 17:14:45 +08:00
parent 71342d4384
commit 30da00c517
2 changed files with 24 additions and 11 deletions

View File

@@ -118,6 +118,21 @@ impl LeveledCompactionController {
}
}
priorities.sort_by(|a, b| a.partial_cmp(b).unwrap().reverse());
println!(
"target level sizes: {:?}, real level sizes: {:?}, base_level: {}",
target_level_size
.iter()
.map(|x| format!("{:.3}MB", *x as f64 / 1024.0 / 1024.0))
.collect::<Vec<_>>(),
real_level_size
.iter()
.map(|x| format!("{:.3}MB", *x as f64 / 1024.0 / 1024.0))
.collect::<Vec<_>>(),
base_level,
);
println!("compaction triggered by priority: {:?}", priorities);
let priority = priorities.first();
if let Some((_, level)) = priority {
println!(