MCPcopy Create free account
hub / github.com/aws/clock-bound / min_rtt

Function min_rtt

clock-bound/src/daemon/clock_sync_algorithm/ring_buffer.rs:316–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

314
315 #[test]
316 fn min_rtt() {
317 let mut buffer = RingBuffer::new(NonZeroUsize::new(3).unwrap());
318
319 let events = vec![
320 TestEvent::pre_and_rtt(100, 30),
321 TestEvent::pre_and_rtt(200, 10),
322 TestEvent::pre_and_rtt(300, 20),
323 ];
324
325 for event in events {
326 buffer.push(event);
327 }
328
329 let min_rtt = buffer.min_rtt().unwrap();
330 assert_eq!(min_rtt.rtt(), TscDiff::new(10));
331 }
332
333 #[test]
334 fn min_rtt_in_quarter_newest() {

Callers

nothing calls this directly

Calls 3

min_rttMethod · 0.80
newFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected