mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
expose the size methods
This commit is contained in:
parent
e96b852107
commit
4aae07d5f5
14 changed files with 39 additions and 17 deletions
|
@ -223,6 +223,16 @@ impl Index {
|
|||
self.env.path()
|
||||
}
|
||||
|
||||
/// Returns the size used by the index without the cached pages.
|
||||
pub fn used_size(&self) -> Result<u64> {
|
||||
Ok(self.env.non_free_pages_size()?)
|
||||
}
|
||||
|
||||
/// Returns the real size used by the index.
|
||||
pub fn on_disk_size(&self) -> Result<u64> {
|
||||
Ok(self.env.real_disk_size()?)
|
||||
}
|
||||
|
||||
pub fn copy_to_path<P: AsRef<Path>>(&self, path: P, option: CompactionOption) -> Result<File> {
|
||||
self.env.copy_to_path(path, option).map_err(Into::into)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue