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

Cannot use URL from openjdk code review server #52

Closed
mcimadamore opened this issue May 16, 2024 · 6 comments
Closed

Cannot use URL from openjdk code review server #52

mcimadamore opened this issue May 16, 2024 · 6 comments

Comments

@mcimadamore
Copy link

I work on OpenJDK, and I'm trying to publish a JMH report using your great tool. I've uploaded my JMH json files here:

https://cr.openjdk.org/~mcimadamore/jdk/8331865/

Ideally, I'd like to pass the two URLs to the visualizer, so that I can then share the resulting page. But I'm not having luck with using such URLs. Using gist works (or uploading locally) - but I wonder if there's a reason as to why the URL function doesn't seem to work? (and, maybe also making sure it's not an issue on our end, e.g. our code review server).

@mcimadamore
Copy link
Author

See this comment:
openjdk/jdk#19251 (comment)

@plokhotnyuk
Copy link

plokhotnyuk commented May 16, 2024

I work on OpenJDK, and I'm trying to publish a JMH report using your great tool. I've uploaded my JMH json files here:

https://cr.openjdk.org/~mcimadamore/jdk/8331865/

Ideally, I'd like to pass the two URLs to the visualizer, so that I can then share the resulting page. But I'm not having luck with using such URLs. Using gist works (or uploading locally) - but I wonder if there's a reason as to why the URL function doesn't seem to work? (and, maybe also making sure it's not an issue on our end, e.g. our code review server).

I tried this URL and got following errors in the browser console:

image
You can follow Learn More links to see a list of possible mitigations

@mcimadamore
Copy link
Author

Many thanks for getting back to me. I've verified that indeed there are errors on the browser console, and raised the issue to our team in charge of the server configuration. I will update this issue once I know more. Thanks again.

@jzillmann
Copy link
Owner

Hey @mcimadamore , it's a CORS issue. Because JMH visualizer doesn't have a server and just runs in the browser, it cannot fetch content from servers with a restrictive content policy.

Workaround would be to use a proxy.
You could manually wrap your urls into e.g. CorsProxy (https://corsproxy.io):

So
https://cr.openjdk.org/~mcimadamore/jdk/8331865/loop_over_00_baseline.json
will become
https://corsproxy.io/?https://cr.openjdk.org/~mcimadamore/jdk/8331865/loop_over_00_baseline.json and that will be loadable with the visualizer
https://jmh.morethan.io/?source=https://corsproxy.io/?https://cr.openjdk.org/~mcimadamore/jdk/8331865/loop_over_00_baseline.json

@mcimadamore
Copy link
Author

So
https://cr.openjdk.org/~mcimadamore/jdk/8331865/loop_over_00_baseline.json
will become
https://corsproxy.io/?https://cr.openjdk.org/~mcimadamore/jdk/8331865/loop_over_00_baseline.json and that will be loadable with the visualizer
https://jmh.morethan.io/?source=https://corsproxy.io/?https://cr.openjdk.org/~mcimadamore/jdk/8331865/loop_over_00_baseline.json

Nice trick/workaround - thanks!

@mcimadamore
Copy link
Author

Closing this issue as it seems related to the configuration of the openjdk server cr.openjdk.org more than anything else. The workaround using CorsProxy works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants