add some stats on the batches

This commit is contained in:
Tamo
2024-11-19 18:19:41 +01:00
parent 229fa0f902
commit 4abcd9c04e
110 changed files with 688 additions and 323 deletions

View File

@ -349,13 +349,14 @@ pub fn snapshot_canceled_by(rtxn: &RoTxn, db: Database<BEU32, RoaringBitmapCodec
pub fn snapshot_batch(batch: &Batch) -> String {
let mut snap = String::new();
let Batch { uid, details, started_at, finished_at } = batch;
let Batch { uid, details, stats, started_at, finished_at } = batch;
if let Some(finished_at) = finished_at {
assert!(finished_at > started_at);
}
snap.push('{');
snap.push_str(&format!("uid: {uid}, "));
snap.push_str(&format!("details: {}, ", serde_json::to_string(details).unwrap()));
snap.push_str(&format!("stats: {}, ", serde_json::to_string(stats).unwrap()));
snap.push('}');
snap
}