Skip to content
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

crtime: add MonoFromTime method #6

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

RaduBerinde
Copy link
Member

@RaduBerinde RaduBerinde commented Oct 29, 2024

This is useful when we have a time.Time that we can't change to use
Mono, for example ctx.Deadline().


This change is Reviewable

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaduBerinde)


crtime/monotonic_test.go line 30 at r1 (raw file):

c > b+Mono(time.Millisecond)

Isn't this part susceptible to flaking due to overload or a poorly timed goroutine/process preemption?

This is useful when we have a `time.Time` that we can't change to use
`Mono`, for example `ctx.Deadline()`.
Copy link
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @nvanbenschoten)


crtime/monotonic_test.go line 30 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

c > b+Mono(time.Millisecond)

Isn't this part susceptible to flaking due to overload or a poorly timed goroutine/process preemption?

Possibly, updated.

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RaduBerinde)

@RaduBerinde
Copy link
Member Author

TFTR!

@RaduBerinde RaduBerinde merged commit 1184f0e into cockroachdb:main Oct 29, 2024
7 checks passed
@RaduBerinde RaduBerinde deleted the mono-from-time branch October 29, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants