-
Notifications
You must be signed in to change notification settings - Fork 649
summary: Fill recent_downloads
fields
#2452
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
Conversation
8ad0125
to
e7d791c
Compare
I have 2 potential concerns here, one technical and one social. On the technical side, the change looks fine to me but I haven't had a chance to look at On the social side, I'm a bit worried that displaying this information prominently could encourage people to seek to inflate their download counts. Nothing really prevents such bad behavior today, but displaying an exact value of this metric could be perceived by some as a target to be reached. (On the other hand, we already expose this metric for crates via the API so this data is already available, just not currently shown in the UI as far as I am aware.) I'll add this to the agenda to discuss with the team. |
I basically just tried to mimic the code that was already existing for the crates endpoint. I was hoping that it was fast enough 😅 The good news is that on the frontend side we've lately added two changes that make a slightly slower response time on this request not as bad anymore. First, we cache the result of the request for the runtime of the app so that we only need to request it once and not for every visit of the frontpage. And second, we no longer block the rendering of the rest of the frontpage on the response of that request. Instead, we display placeholders for those parts of the frontpage that are still loading.
we already display it in the crate rows for search pages, etc. and we have it as a sort option for most of the pages. if we didn't show the the top10 recent downloads crates on the frontpage I'd say we didn't need it, but since we do it seems strange to display a ranking, but not the actual numbers that are related to that ranking. |
Okay, I'll rescind my concerns about showing recent downloads. I think this just needs a few tweaks for performance reasons. For the final query, would you switch back to an inner join and drop the call to Original query
Current query
My proposed tweaks
|
I'll see if I can get that to compile... 😅 |
@jtgeibel done, thanks for the help! :) |
LGTM! @bors r+ |
📌 Commit 375c058 has been approved by |
☀️ Test successful - checks-travis |
This will allow us to show something like "3,442 downloads in the past 90 days" in the "Recent Downloads" list on the frontpage.
r? @jtgeibel