Repository navigation
11622 : OutlierDetection should use Ticker, not TimeProvider #12110
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
Changes from 1 commit
ec44974
8f513b7
debbd7a
3735a6c
c831f1e
b8c0e0c
aaf5016
e336fa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,12 +148,12 @@ public Status acceptResolvedAddresses(ResolvedAddresses resolvedAddresses) { | |
| // On the first go we use the configured interval. | ||
| initialDelayNanos = config.intervalNanos; | ||
| } else { | ||
| Long currentTickerTimeNanos = ticker.read(); | ||
| Long elepsedTimeNanos = currentTickerTimeNanos - detectionTimerStartNanos; | ||
| long currentTickerTimeNanos = ticker.read(); | ||
| long elapsedTimeNanos = currentTickerTimeNanos - detectionTimerStartNanos; | ||
| // If a timer has started earlier we cancel it and use the difference between the start | ||
| // time and now as the interval. | ||
| initialDelayNanos = Math.max(0L, | ||
| config.intervalNanos - elepsedTimeNanos); | ||
| config.intervalNanos - elapsedTimeNanos); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can keep everything in-line here and above to make it less confusing. Storing in a variable doesn't change anything here, but sure you need to do Math.max(0L, ...) to not have any negative value there.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The max is unnecessary. For it to overflow would require the process to be running for 292 years.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed the review comments |
||
| } | ||
|
|
||
| // If a timer has been previously created we need to cancel it and reset all the call counters | ||
|
|
||

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.
This was fine I believe, this doesn't need any change.
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.
Addressed the review comments