Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

record insert time for every batch insert

and without relying on indirect tokio scheduling for timing measurements

Changed files
+9 -1
ufos
+9 -1
ufos/src/storage.rs
···
Unit::Microseconds,
"batches that took more than 3s to insert"
);
+
describe_histogram!(
+
"storage_batch_insert_time",
+
Unit::Microseconds,
+
"total time to insert one commit batch"
+
);
while let Some(event_batch) = batches.recv().await {
let token = CancellationToken::new();
let cancelled = token.clone();
···
let mut me = self.clone();
move || {
let _guard = token.drop_guard();
-
me.insert_batch(event_batch)
+
let t0 = Instant::now();
+
let r = me.insert_batch(event_batch);
+
histogram!("storage_batch_insert_time").record(t0.elapsed().as_micros() as f64);
+
r
}
})
.await??;