-
Notifications
You must be signed in to change notification settings - Fork 579
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
Defer creation of current-time-in-seconds thread until runtime #3385
Conversation
Comment copied from the other PR:
|
…; for updating each EDR's current time, keep list of EDRs rather than of Runnables
…stion; convert updates of current times from .forEach to for-each
metrics/metrics/src/main/java/io/helidon/metrics/ExponentiallyDecayingReservoir.java
Outdated
Show resolved
Hide resolved
The refactoring in the previous push takes the single-thread executor handling out of |
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.
LGTM
Replaces #3374
Resolves #3389
This PR picks up Tomas's earlier one (#3374) and incorporates Daniel's comments.
The separate commits divide up the changes clearly, I hope.
Aside from adopting Daniel's suggestion for a three-state model for the executor, the other main change is to maintain a list of
ExponentiallyDecayingReservoir
s for which their current-time-in-seconds should be updated periodically, rather than keep a list ofRunnable
; we don't need to be that general and it's clearer and probably faster this way.Also, the earlier shutdown processing (
awaitTermination
to wait for the scheduled tasks to finish) seemed to time out rather than complete, so I've changed it to useshutdownNow
instead.