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

Replace active wait loop with a sleep in the Query thread. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

richcar58
Copy link

The conditional on line 500 ( if (thisNow > nextQueryMillis) {... ) is executed in a tight loop, so if the next query time isn't reached yet, the condition is immediately tested again. By default, the time between query intervals is 15 seconds. If the number of queries attempted per interval is relatively small, the amount of time the query thread spins on the conditional will eat cpu resources and distort the results.

This pull request replaces the active wait with a precisely calculated sleep. In addition, unused imports are remove.

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.

1 participant