feat(stats): publish per-package download statistics #253
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/download-stats-packages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the data for the package view of the rpkgs.com download dashboard (rpkgs/website#98).
stats/packages.tswritesstats/packages/<name>.jsonper package: daily downloads and clients, latest version, 30-day rank, and versions, distributions, R versions and architectures for 7 days, 30 days and all time.downloads.jsongainspackagesandbytesper window andbreakdownsByWindow;breakdownsstays as the 30-day set, so the current page keeps working./stats/packages/*, checked against the Bunny API).Same counting rules as before: own runners excluded, a download is a distinct client, package version and UTC day.
Verification
bun test stats: 16 tests pass, including version ordering.publish.ts --outagainst the live database wrote the main file and 106 package files;climatches a direct SQL count (5 downloads, 2 clients, 3.6.6).🤖 Generated with Claude Code