- Notifications
You must be signed in to change notification settings - Fork 231
use timedelta for any durations #1488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Seconds type only allows comparisons, additions and substractions with other objects of type Seconds, not with unit-less floats or ints. This should ensure that we only ever compare durations of the same type, not e.g. milliseconds to seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far. I'll do an in-depth review for accuracy once tests are passing. But overall I think it's a good direction. We definitely need to standardize so this doesn't bite us again.
/test full |
also, introduce a _DurationConfigValue that handles everything
/test full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid! Let me know if I can help with the integration test failures.
f863e2d
to 02b2751
Compare it's impossible to know which unit the sum value in Prometheus summaries has, so we can't properly convert it to a timedelta.
02b2751
to 6e9035e
Compare /test full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much goodness here. Quite a few places where I noted "oh, that's much clearer" while reviewing. 👍
timedelta
only allows comparisons, additions and substractionswith other objects of type
timedelta
, not with unit-less floats or ints.This should ensure that we only ever compare durations of the same
unit, not e.g. milliseconds to seconds.