feat(http): calculate updates' and uuids' dbs size

This commit is contained in:
Alexey Shekhirin 2021-04-09 15:41:24 +03:00
parent ae1655586c
commit adfdb99abc
No known key found for this signature in database
GPG key ID: AF9A26AA133B5B98
17 changed files with 121 additions and 25 deletions

View file

@ -0,0 +1,16 @@
use walkdir::WalkDir;
pub trait EnvSizer {
fn size(&self) -> u64;
}
impl EnvSizer for heed::Env {
fn size(&self) -> u64 {
WalkDir::new(self.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())
}
}

View file

@ -1,4 +1,6 @@
pub mod authentication;
pub mod compression;
mod env;
pub use authentication::Authentication;
pub use env::EnvSizer;