Previously, we used Instant::recent() to get a cached view of the
monotonic clock and used that to set the timestamp for the
sessions. This could result in incorrect latency reporting if the
cached value is sufficiently stale or if another thread refreshes
the cached value while a thread is processing many events.
This change corrects how the latency is being measured by using
Instant::now() when poll returns as the timestamp for all events
being processed in that loop iteration.
Previously, we used
Instant::recent()
to get a cached view of the monotonic clock and used that to set the timestamp for the sessions. This could result in incorrect latency reporting if the cached value is sufficiently stale or if another thread refreshes the cached value while a thread is processing many events.This change corrects how the latency is being measured by using
Instant::now()
when poll returns as the timestamp for all events being processed in that loop iteration.