-
Notifications
You must be signed in to change notification settings - Fork 918
GODRIVER-2674 use time.Duration instead of durationNanos #1120
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
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.
The replacement seems reasonable though it is backward-breaking.
Instead, in v1.x, we can deprecate the current fields while adding new fields named Duration
that are type time.Duration
.
We can retire these DurationNanos
fields in the upcoming v2 driver.
AppendString("name", "CommandFailedEvent"). | ||
AppendDouble("observedAt", getSecondsSinceEpoch()). | ||
AppendInt64("durationNanos", evt.DurationNanos). | ||
AppendInt64("duration", int64(evt.Duration)). |
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.
How is the bson used? Why do other events not use Duration (non-exhaustive)?
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.
This BSON document is used for test assertions. It must remain the same for the test assertions to continue working.
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.
Hey @jtagcat sorry about the slow review and thanks for the edits! I have one required change, but it otherwise looks great!
AppendString("name", "CommandFailedEvent"). | ||
AppendDouble("observedAt", getSecondsSinceEpoch()). | ||
AppendInt64("durationNanos", evt.DurationNanos). | ||
AppendInt64("duration", int64(evt.Duration)). |
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.
This BSON document is used for test assertions. It must remain the same for the test assertions to continue working.
AppendString("name", "CommandFailedEvent"). | ||
AppendDouble("observedAt", getSecondsSinceEpoch()). | ||
AppendInt64("durationNanos", evt.DurationNanos). | ||
AppendInt64("duration", int64(evt.Duration)). |
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.
The structure of this BSON document must remain the same for test assertions to continue working.
AppendInt64("duration", int64(evt.Duration)). | |
AppendInt64("durationNanos", duration.Nanoseconds()). |
Closing in favor of #1193 |
Same as #1105