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 netlify function for download statistics #383

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

oeway
Copy link
Collaborator

@oeway oeway commented Apr 8, 2024

This is a proof-of-concept for implementing the proxy based download statistics

Basically, we can change a model weight download url like this:

https://bioimage.netlify.app/.netlify/functions/download/10.5281/zenodo.5764892/files/weights.onnx?debug=1

(with ?debug=1, it will return the the generated url but not sending request, for actual use we can remove it)

This will return something like:

{"actualFileUrl":"https://zenodo.org/api/records/5764892/files/weights.onnx/content","matomoReportUrl":"https://bioimage.matomo.cloud/matomo.php?download=https://doi.org/10.5281/zenodo.5764892&idsite=1&rec=1&r=646242&h=13&m=35&s=20&url=http://bioimage.io/#/?id=10.5281/zenodo.5764892&uadata=%7B%22brands%22%3A%5B%7B%22brand%22%3A%22unknown%22%2C%22version%22%3A%22unknown%22%7D%5D%7D"}

The actualFileUrl will be send for download, meaning the user will be redirected to the actual URL, and matomoReportUrl will be used for reporting a model download for a model. If you actually visit the matamoReportUrl, you will see the report here in realtime: https://bioimage.matomo.cloud/

We can also get the model statistics via API, @FynnBe has done some work here: bioimage-io/spec-bioimage-io#504

cc @FynnBe @ctr26

Copy link

netlify bot commented Apr 8, 2024

Deploy Preview for bioimage ready!

Name Link
🔨 Latest commit 7a95b41
🔍 Latest deploy log https://app.netlify.com/sites/bioimage/deploys/661387ce817d6800080ac9a0
😎 Deploy Preview https://deploy-preview-383--bioimage.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@oeway oeway merged commit 1170654 into main Apr 8, 2024
6 checks passed
@FynnBe FynnBe deleted the add-netlify-download-statistics branch April 8, 2024 08:47
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

Successfully merging this pull request may close these issues.

1 participant