mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
feat(http): calculate updates' and uuids' dbs size
This commit is contained in:
parent
ae1655586c
commit
adfdb99abc
17 changed files with 121 additions and 25 deletions
|
@ -5,10 +5,10 @@ use std::sync::Arc;
|
|||
use anyhow::{bail, Context};
|
||||
use milli::obkv_to_json;
|
||||
use serde_json::{Map, Value};
|
||||
use walkdir::WalkDir;
|
||||
|
||||
pub use search::{SearchQuery, SearchResult, DEFAULT_SEARCH_LIMIT};
|
||||
pub use updates::{Facets, Settings, UpdateResult};
|
||||
use crate::helpers::EnvSizer;
|
||||
|
||||
mod search;
|
||||
mod updates;
|
||||
|
@ -55,11 +55,7 @@ impl Index {
|
|||
let stop_words = self
|
||||
.stop_words(&txn)?
|
||||
.map(|stop_words| -> anyhow::Result<BTreeSet<_>> {
|
||||
Ok(stop_words
|
||||
.stream()
|
||||
.into_strs()?
|
||||
.into_iter()
|
||||
.collect())
|
||||
Ok(stop_words.stream().into_strs()?.into_iter().collect())
|
||||
})
|
||||
.transpose()?
|
||||
.unwrap_or_else(BTreeSet::new);
|
||||
|
@ -127,13 +123,8 @@ impl Index {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn size(&self) -> anyhow::Result<u64> {
|
||||
Ok(WalkDir::new(self.env.path())
|
||||
.into_iter()
|
||||
.filter_map(|entry| entry.ok())
|
||||
.filter_map(|entry| entry.metadata().ok())
|
||||
.filter(|metadata| metadata.is_file())
|
||||
.fold(0, |acc, m| acc + m.len()))
|
||||
pub fn size(&self) -> u64 {
|
||||
self.env.size()
|
||||
}
|
||||
|
||||
fn fields_to_display<S: AsRef<str>>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue