mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 08:44:27 +01:00
Display the number of entries in the infos crate
This commit is contained in:
parent
1aad66bdaa
commit
7ff4a2a708
@ -882,16 +882,19 @@ fn size_of_databases(index: &Index, rtxn: &heed::RoTxn, names: Vec<String>) -> a
|
|||||||
|
|
||||||
let mut key_size: u64 = 0;
|
let mut key_size: u64 = 0;
|
||||||
let mut val_size: u64 = 0;
|
let mut val_size: u64 = 0;
|
||||||
|
let mut number_entries: u64 = 0;
|
||||||
for result in database.iter::<_, ByteSlice, ByteSlice>(rtxn)? {
|
for result in database.iter::<_, ByteSlice, ByteSlice>(rtxn)? {
|
||||||
let (k, v) = result?;
|
let (k, v) = result?;
|
||||||
key_size += k.len() as u64;
|
key_size += k.len() as u64;
|
||||||
val_size += v.len() as u64;
|
val_size += v.len() as u64;
|
||||||
|
number_entries += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("The {} database weigh:", name);
|
println!("The {} database weigh:", name);
|
||||||
println!("\ttotal key size: {}", Byte::from(key_size).get_appropriate_unit(true));
|
println!("\ttotal key size: {}", Byte::from(key_size).get_appropriate_unit(true));
|
||||||
println!("\ttotal val size: {}", Byte::from(val_size).get_appropriate_unit(true));
|
println!("\ttotal val size: {}", Byte::from(val_size).get_appropriate_unit(true));
|
||||||
println!("\ttotal size: {}", Byte::from(key_size + val_size).get_appropriate_unit(true));
|
println!("\ttotal size: {}", Byte::from(key_size + val_size).get_appropriate_unit(true));
|
||||||
|
println!("\tnumber of entries: {}", number_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user