backend: Debug loop times

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-01-10 11:08:29 +02:00
parent ad1c3558ad
commit b3a467526d
+4
View File
@@ -551,16 +551,20 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for UnstableBackend<T> {
let now = std::time::Instant::now();
let mut mem_log = vec![];
let mut loop_times = 0;
// Now we can attempt to associate tx events with pinned blocks.
let tx_stream = futures::stream::poll_fn(move |cx| {
loop {
loop_times += 1;
if now.elapsed().as_secs() > 240 {
println!("Fin block {:?}", unsafe { &FIN_BLOCK });
println!("Pruned block {:?}", unsafe { &PRUNED });
println!("MemLog: {:#?}", mem_log);
println!("SeenBlocksLog: {:#?}", seen_blocks);
println!("SeenOther: {:#?}", seen_other);
println!("Loop times: {:#?}", loop_times);
panic!("{:#?} {:#?} {:#?}", mem_log, seen_blocks, seen_other);
}