mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 16:31:18 +00:00
Improve logging of lmdb migration 1
This commit is contained in:
parent
58bd2b7299
commit
2d0ebafcab
@ -52,6 +52,12 @@ impl Storage {
|
||||
let f = |txn: &mut RwTransaction<'a>| -> Result<(), Error> {
|
||||
// track progress
|
||||
let total = self.get_event_stats()?.entries();
|
||||
|
||||
tracing::info!(
|
||||
"LMDB Migration 1: Computing and storing event relationships for {} events...",
|
||||
total
|
||||
);
|
||||
|
||||
let mut count = 0;
|
||||
|
||||
let event_txn = self.env.begin_ro_txn()?;
|
||||
@ -68,8 +74,10 @@ impl Storage {
|
||||
|
||||
// track progress
|
||||
count += 1;
|
||||
if count % 2000 == 0 {
|
||||
tracing::info!("{}/{}", count, total);
|
||||
for checkpoint in &[10, 20, 30, 40, 50, 60, 70, 80, 90] {
|
||||
if count == checkpoint * total / 100 {
|
||||
tracing::info!("{}% done", checkpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user