feat(stats): publish per-package download statistics
Write one JSON file per package to stats/packages/<name>.json with its daily series and its versions, distributions, R versions and architectures for 7 days, 30 days and all time, for the package view of the rpkgs.com dashboard. - Add distinct package and byte counts to each window in downloads.json. - Add breakdowns for every window as breakdownsByWindow, keeping breakdowns as the 30-day set for existing readers. - Upload package files before the main file and purge them with one wildcard purge.
This commit is contained in:
parent
72440f9cf5
commit
06afded1fe
1 changed files with 217 additions and 26 deletions
8
stats/packages.test.ts
Normal file
8
stats/packages.test.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { expect, test } from 'bun:test';
|
||||
import { compareVersions } from './packages';
|
||||
|
||||
test('versions order numerically, not as text', () => {
|
||||
expect(['1.10.0', '1.9.2', '1.2-3', '1.2-10'].sort(compareVersions)).toEqual(['1.2-3', '1.2-10', '1.9.2', '1.10.0']);
|
||||
expect(compareVersions('3.6.6', '3.6.6')).toBe(0);
|
||||
expect(compareVersions('1.0', '1.0.1')).toBeLessThan(0);
|
||||
});
|
||||
Loading…
Reference in a new issue