Skip to content

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

@netlify
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
@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.

2 participants