Skip to content

Conversation

@nicois
Copy link
Contributor

@nicois nicois commented Oct 30, 2025

nanoseconds were being used in conjuction with milliseconds. Clarify the units in the variable name, and use time.monotonic() which returns fractional seconds already.

Previously, when calculating the polling timeout, the incorrect use of units would result in 0. This would make the poll() function return instantly, rather than efficiently waiting until the next event for up to a second.

This change should therefore decrease CPU consumption and slightly decrease latency before new events are detected and processed.

nanoseconds were being used in conjuction with milliseconds.
Clarify the units in the variable name, and use `time.monotonic()` which
returns fractional seconds already.

Previously, when calculating the polling timeout, the incorrect use of
units would result in `0`. This would make the `poll()` function return
instantly, rather than efficiently waiting until the next event for up
to a second.

This change should therefore decrease CPU consumption and slightly
decrease latency before new events are detected and processed.
@nicois nicois force-pushed the nicois/fix-journalpump-polling-interval branch from 73d75b4 to 351e848 Compare October 30, 2025 21:00
@nicois nicois changed the title Use milliseconds when calculating polling frequency fix: use milliseconds when calculating polling frequency Oct 30, 2025
Copy link

@zaki-aiven zaki-aiven left a comment

Choose a reason for hiding this comment

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

coolio

@allhailwesttexas allhailwesttexas merged commit c0d7aac into master Nov 13, 2025
4 checks passed
@allhailwesttexas allhailwesttexas deleted the nicois/fix-journalpump-polling-interval branch November 13, 2025 21:09
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.

5 participants