Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove usage of the stats endpoint to get origin package counts #719
Since the only place we were using the stats endpoint was to list the package counts for an origin I have completely removed it from the API.
This will also allow on-prem users to see their package counts for their origins.
Signed-off-by: Elliott Davis firstname.lastname@example.org
Not that this is a blocker but I do have a couple of questions about this.
Second, and possibly more importantly - are we removing this endpoint because it's not useful? Is it actually not useful, or is it just not being effectively utilized? I can see a reality where having an origin's stats endpoint could be super useful if the right pieces of data are being exposed. I'd hate to see this removed primarily for simplification of the API if there is future work that could be useful in here.
@eeyun to answer your first question, yes. Instead of sending back just the origin row from the origins table, I'm now sending back the row, plus the package count in the
This feature was added when we had an overall stats view in the UI. Upon looking at the metrics for page usage from users we decided to remove that view because it was so underutilized. We didn't remove the accompanying API because it was still in use to get the origin package counts for the "My Origins" view. The query that was removed was an extremely expensive call to the database and was called multiple times when a user clicked anywhere on an origin view. So, while this does reduce our overall API surface area it also reduces load on the database and enables on-prem users to see package totals (since the stats API was only exposed if you had jobsrv enabled)