From 4a88b28e608465eb3c23cbe7f0cb589ed6110962 Mon Sep 17 00:00:00 2001 From: Auri Date: Sat, 10 Jun 2023 15:46:36 +0200 Subject: [PATCH] fix(subscriber): remove clock skew warning in `start_poll` (#434) --- console-subscriber/src/stats.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/console-subscriber/src/stats.rs b/console-subscriber/src/stats.rs index c8b0a942b..1a281b031 100644 --- a/console-subscriber/src/stats.rs +++ b/console-subscriber/src/stats.rs @@ -518,17 +518,8 @@ impl PollStats { None => return, // Async operations record polls, but not wakes }; - let elapsed = match at.checked_duration_since(scheduled) { - Some(elapsed) => elapsed, - None => { - eprintln!( - "possible Instant clock skew detected: a poll's start timestamp \ - was before the wake time/last poll end timestamp\nwake = {:?}\n start = {:?}", - scheduled, at - ); - return; - } - }; + // `at < scheduled` is possible when a task switches threads between polls. + let elapsed = at.saturating_duration_since(scheduled); // if we have a scheduled time histogram, add the timestamp timestamps.scheduled_histogram.record_duration(elapsed);