-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add timer to track queue delay in InstrumentedSource.queue #7601
Conversation
and use it from TrackerImpl. CHANGELOG_BEGIN CHANGELOG_END
a9b4767
to
ce2fab6
Compare
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.
Broadly looks great to me. Just some minor suggestions.
ledger/metrics/src/test/scala/com/daml/metrics/InstrumentedSourceSpec.scala
Outdated
Show resolved
Hide resolved
.map { x => | ||
// Sleep to delay the processing of the next element. | ||
Thread.sleep(5) | ||
x | ||
} |
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.
Perhaps use the scheduler here rather than blocking a Future thread?
.map { x => | |
// Sleep to delay the processing of the next element. | |
Thread.sleep(5) | |
x | |
} | |
.mapAsync(1) { x => | |
scheduler.scheduleOnce(5.seconds)(Future(x)) | |
} |
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.
Thanks, good suggestion. I'll give it a try. (It's 5 millis though).
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.
scheduler didn't have the right methods, but found this instead: https://doc.akka.io/docs/akka/current/futures.html.
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.
Oh, my bad. Totally fine with the Thread.sleep
then.
Add timer to track queue delay in InstrumentedSource.queue and use it from TrackerImpl.
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.