return the on disk size actually used by meilisearch

This commit is contained in:
Tamo 2023-05-25 18:30:30 +02:00
parent 35d5556f1f
commit c9b65677bf
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
8 changed files with 169 additions and 92 deletions

View file

@ -554,10 +554,16 @@ impl IndexScheduler {
&self.index_mapper.indexer_config
}
/// Return the real database size (i.e.: The size **with** the free pages)
pub fn size(&self) -> Result<u64> {
Ok(self.env.real_disk_size()?)
}
/// Return the used database size (i.e.: The size **without** the free pages)
pub fn used_size(&self) -> Result<u64> {
Ok(self.env.non_free_pages_size()?)
}
/// Return the index corresponding to the name.
///
/// * If the index wasn't opened before, the index will be opened.