Reduce debug (#13319)

This commit is contained in:
sakridge
2020-10-30 16:18:44 -07:00
committed by GitHub
parent d2ee9db214
commit 8415c22b59

View File

@ -167,7 +167,23 @@ fn update_retransmit_stats(
packets_by_slot.clear(); packets_by_slot.clear();
drop(packets_by_slot); drop(packets_by_slot);
let mut packets_by_source = stats.packets_by_source.lock().unwrap(); let mut packets_by_source = stats.packets_by_source.lock().unwrap();
info!("retransmit: packets_by_source: {:?}", packets_by_source); let mut top = BTreeMap::new();
let mut max = 0;
for (source, num) in packets_by_source.iter() {
if *num > max {
top.insert(*num, source.clone());
if top.len() > 5 {
let last = *top.iter().next().unwrap().0;
top.remove(&last);
}
max = *top.iter().next().unwrap().0;
}
}
info!(
"retransmit: top packets_by_source: {:?} len: {}",
top,
packets_by_source.len()
);
packets_by_source.clear(); packets_by_source.clear();
} }
} }