Skip to content

Prefer erlang:monotonic_time/0 for elapsed time measurements #10928

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

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

the-mikedavis
Copy link
Collaborator

@the-mikedavis the-mikedavis commented Apr 5, 2024

This is now the recommended way to measure durations with the time API: https://www.erlang.org/doc/apps/erts/time_correction#how-to-work-with-the-new-api. This is mostly a cosmetic change though since it's only used in/for log messages.

\cc @dumbbell I've changed the log message for the time it takes to regen the feature flag registry to be milliseconds instead of microsecond as it takes ~35-40ms for me locally. (Similar to #10674)

@the-mikedavis the-mikedavis force-pushed the md/monotonic-elapsed-time branch from c87aecc to 1b35c3f Compare April 13, 2024 15:28
@the-mikedavis
Copy link
Collaborator Author

I reverted the change to switch to milliseconds for the feature flag registry regen since #10988 might reduce the time it takes to generate the registry down to hundreds of microseconds. So now this patch just switches to monotonic_time - no changes to log messages

@the-mikedavis the-mikedavis merged commit 2f057fa into main Apr 13, 2024
21 checks passed
@the-mikedavis the-mikedavis deleted the md/monotonic-elapsed-time branch April 13, 2024 16:34
the-mikedavis added a commit that referenced this pull request Apr 13, 2024
Prefer `erlang:monotonic_time/0` for elapsed time measurements (backport #10928)
ansd added a commit that referenced this pull request Jun 6, 2024
Monotonic time instead of wall clock time should be used to measure a
duration.

This is mostly a cosmetic change given that consumer timeouts are 30
mins by default.

See also
rabbitmq/khepri#239
#10928
ansd added a commit that referenced this pull request Jun 6, 2024
Monotonic time instead of wall clock time should be used to measure a
duration.

This is mostly a cosmetic change given that consumer timeouts are 30
mins by default.

See also
rabbitmq/khepri#239
#10928
mergify bot pushed a commit that referenced this pull request Jun 6, 2024
Monotonic time instead of wall clock time should be used to measure a
duration.

This is mostly a cosmetic change given that consumer timeouts are 30
mins by default.

See also
rabbitmq/khepri#239
#10928

(cherry picked from commit f5d2fd6)
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