You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TimeProvider provides wall time. That can move forward and backward as time is adjusted. OutlierDetection is measuring durations, so it should use a monotonic clock. We use Ticker (either Guava's or Deadline's, but generally Guava's) for that. FakeClock supports both for testing.
Doing a quick audit, this seems to be the only present incorrect use of TimeProvider.
I feel like I noticed this before, but I don't know why I didn't change it at the time. Maybe I had wanted to change the weird Long usage as well. (E.g., EPOCH = currentTimeNanos() - 1 and use EPOCH instead of null.)
TimeProvider provides wall time. That can move forward and backward as time is adjusted. OutlierDetection is measuring durations, so it should use a monotonic clock. We use Ticker (either Guava's or Deadline's, but generally Guava's) for that. FakeClock supports both for testing.
Doing a quick audit, this seems to be the only present incorrect use of TimeProvider.
I feel like I noticed this before, but I don't know why I didn't change it at the time. Maybe I had wanted to change the weird
Long
usage as well. (E.g.,EPOCH = currentTimeNanos() - 1
and use EPOCH instead ofnull
.)CC @kannanjgithub
The text was updated successfully, but these errors were encountered: