Add more statistics

This commit is contained in:
Mike Dilger 2024-10-26 07:39:09 +13:00
parent 6d7d3f4afe
commit 006ecadf9c
2 changed files with 11 additions and 2 deletions

View File

@ -179,10 +179,10 @@ async fn main() -> Result<(), Error> {
}
}
chorus::print_stats();
log::info!(target: "Server", "Syncing and shutting down.");
let _ = GLOBALS.store.get().unwrap().sync();
chorus::print_stats();
Ok(())
}

View File

@ -595,6 +595,15 @@ pub fn print_stats() {
GLOBALS.bytes_outbound.load(Ordering::Relaxed),
(GLOBALS.bytes_outbound.load(Ordering::Relaxed) as f32) / (runtime as f32)
);
if let Ok(status) = GLOBALS.store.get().unwrap().stats() {
log::info!(
target: "Server",
"Store: {} event bytes in {} events, {} bytes for the indexes",
status.event_bytes,
status.index_stats.i_index_entries,
status.index_stats.disk_usage
);
}
}
/// Load config file