probe: spread probe threads out uniformly in time

This way we're a little less bursty and might notice changes more quickly.
This commit is contained in:
Augie Fackler 2020-07-29 01:17:46 -04:00 committed by Jeremy Wall
parent 6fdce7e8d2
commit f0a7c3ef02

View File

@ -261,6 +261,10 @@ fn main() -> anyhow::Result<()> {
}
});
parent.schedule(Box::new(connect_thread));
// Spread the probe threads out so they're somewhat uniformly distributed.
std::thread::sleep(std::time::Duration::from_micros(
DELAYSECS.flag * 1000000 / (socket_addrs.len() as u64),
))
}
// Blocks forever
parent.wait();