mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +01:00
show column family sizes at trace level
This commit is contained in:
parent
2bf1975e75
commit
cbdeff003d
1 changed files with 11 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use std::{
|
||||
collections::HashSet,
|
||||
collections::{HashMap, HashSet},
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::{Arc, Mutex, RwLock},
|
||||
|
|
@ -104,6 +104,16 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
}),
|
||||
)?;
|
||||
|
||||
tracing::trace!(
|
||||
cf_sizes = ?db.live_files().map(|x| {
|
||||
x.into_iter().fold(HashMap::<_, usize>::new(), |mut acc, x| {
|
||||
*acc.entry(x.column_family_name).or_default() += x.size;
|
||||
acc
|
||||
})
|
||||
}),
|
||||
"Size in bytes of all column families",
|
||||
);
|
||||
|
||||
Ok(Arc::new(Engine {
|
||||
rocks: db,
|
||||
max_open_files: config.database.rocksdb_max_open_files,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue