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

Add ResolutionEventListener#downloadMetadataSuccess to communicate long download times to consumers of MavenPomDownloader #4566

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

bryceatmoderne
Copy link
Contributor

@bryceatmoderne bryceatmoderne commented Oct 10, 2024

What's changed?

Long download times for small files such as maven-metadata.xml can indicate network latency issues to internal artifactories. This PR introduces ResolutionEventListener#downloadMetadataSuccess as a method to relay download times to consumers of MavenPomDownloader 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

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@bryceatmoderne bryceatmoderne marked this pull request as draft October 10, 2024 17:46
bryceatmoderne and others added 2 commits October 10, 2024 13:47
…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>
@pstreef
Copy link
Contributor

pstreef commented Oct 10, 2024

Maybe we should put this on MavenExecutionContextView in stead of the base ExecutionContext?

@bryceatmoderne bryceatmoderne changed the title Add ExecutionContext#getOnDownload to communicate long download times to consumers of MavenPomDownloader Add MavenExecutionContextView#getOnDownloaded to communicate long download times to consumers of MavenPomDownloader Oct 10, 2024
bryceatmoderne and others added 3 commits October 10, 2024 15:08
…onContextView.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ite/rewrite into add-executioncontext-ondownload
@pstreef
Copy link
Contributor

pstreef commented Oct 10, 2024

you should also include MavenArtifactDownloader

@bryceatmoderne
Copy link
Contributor Author

you should also include MavenArtifactDownloader

After looking into this, MavenExecutionContextView.resolutionListener may already provide the desired functionality of this PR...

@bryceatmoderne bryceatmoderne changed the title Add MavenExecutionContextView#getOnDownloaded to communicate long download times to consumers of MavenPomDownloader Add ResolutionEventListener#downloadMetadataSuccess to communicate long download times to consumers of MavenPomDownloader Oct 11, 2024
Comment on lines +606 to +607
ctx.getResolutionListener()
.downloadSuccess(resolvedGav, containingPom, Duration.ofNanos(nanos));
Copy link
Member

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.

Copy link
Contributor Author

@bryceatmoderne bryceatmoderne Oct 15, 2024

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?

@timtebeek timtebeek removed their request for review October 12, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants