-
Notifications
You must be signed in to change notification settings - Fork 337
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 ResolutionEventListener#downloadMetadataSuccess
to communicate long download times to consumers of MavenPomDownloader
#4566
base: main
Are you sure you want to change the base?
Conversation
… to consumers of MavenPomDownloader
rewrite-core/src/main/java/org/openrewrite/InMemoryExecutionContext.java
Outdated
Show resolved
Hide resolved
rewrite-core/src/main/java/org/openrewrite/scheduling/WatchableExecutionContext.java
Outdated
Show resolved
Hide resolved
…ntext.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…eExecutionContext.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Maybe we should put this on |
rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java
Outdated
Show resolved
Hide resolved
ExecutionContext#getOnDownload
to communicate long download times to consumers of MavenPomDownloader
MavenExecutionContextView#getOnDownloaded
to communicate long download times to consumers of MavenPomDownloader
…onContextView.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ite/rewrite into add-executioncontext-ondownload
you should also include |
After looking into this, |
MavenExecutionContextView#getOnDownloaded
to communicate long download times to consumers of MavenPomDownloader
ResolutionEventListener#downloadMetadataSuccess
to communicate long download times to consumers of MavenPomDownloader
ctx.getResolutionListener() | ||
.downloadSuccess(resolvedGav, containingPom, Duration.ofNanos(nanos)); |
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.
So the old, durationless event type still exists but will now never be called? That isn't great. If the old event is still going to exist it should continue to be called.
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.
I would prefer to remove the old event under the assumption only Moderne is consumers of it. Thoughts?
What's changed?
Long download times for small files such as
maven-metadata.xml
can indicate network latency issues to internal artifactories. This PR introducesResolutionEventListener#downloadMetadataSuccess
as a method to relay download times to consumers ofMavenPomDownloader
where they optional log warnings to assist troubleshooting long recipe runs and time outs.What's your motivation?
These changes are intended to assist in troubleshooting recipe run execution time outs.
Anything in particular you'd like reviewers to focus on?
No.
Anyone you would like to review specifically?
@pstreef @timtebeek
Have you considered any alternatives or workarounds?
Currently recorded metrics do not provide file level granularity and doing so would be prohibitively expensive WRT cardinality.
Any additional context
No.
Checklist