Skip to content
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

Process & publish aggregate download stats #927

Open
eloquence opened this issue Sep 19, 2024 · 2 comments
Open

Process & publish aggregate download stats #927

eloquence opened this issue Sep 19, 2024 · 2 comments

Comments

@eloquence
Copy link
Member

We collect aggregate counts on package downloads, and GitHub collects them for asset downloads. No good reason not to publish this data as a static HTML report somewhere; monthly aggregates above a minimal threshold should be safe to publish, and that'll make it easier to work with & reason about both for us and outside contributors.

(Data like this can help inform prioritization decisions, e.g., regarding distribution strategies.)

@almet
Copy link
Contributor

almet commented Oct 15, 2024

Just got the total number of downloads for year 2024 (so far), with this command and jq filters:

Total asset downloads for a specific year:

curl "https://api.github.com/repos/freedomofpress/dangerzone/releases?per_page=100" | jq '[.[] | select(.published_at | startswith("2024-")) | .assets[].download_count] | add'
15008

Also, split up by file extension:

curl "https://api.github.com/repos/freedomofpress/dangerzone/releases?per_page=100" | jq '
[
  .[] | 
  select(.published_at | startswith("2024-")) | 
  .assets[] | 
  {
    extension: (.name | split(".") | last),
    downloads: .download_count
  }
] | 
group_by(.extension) | 
map({
  extension: .[0].extension,
  total_downloads: map(.downloads) | add
})
'
[
  {
    "extension": "asc",
    "total_downloads": 118
  },
  {
    "extension": "dmg",
    "total_downloads": 6299
  },
  {
    "extension": "gz",
    "total_downloads": 1235
  },
  {
    "extension": "msi",
    "total_downloads": 7301
  },
  {
    "extension": "txt",
    "total_downloads": 54
  }
]

@almet
Copy link
Contributor

almet commented Nov 19, 2024

I put something together available at https://dz-stats.notmyidea.org/ for now. I probably should publish the code somewhere so that it builds inside a CI job periodically. What's the best course of action for this @eloquence?

Should I open a new repo?

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

No branches or pull requests

2 participants