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

Add statistic summary for State of JuMP #24

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/repositories.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,38 @@ function prs_by_user(user)
return prs_by_user
end

function state_of_jump_statistics()
old_date = Dates.today() - Dates.Year(1)
# Downloads
df = get_historical_downloads()
n_downloads = sum(df[df.date.>=old_date, :].request_count_sum)
# PRs and issues
data = JSON.parsefile(joinpath(DATA_DIR, "data.json"))
prs_opened, issues_opened, contributors = 0, 0, Set{String}()
for (pkg, items) in data, item in items
if Dates.DateTime(item["date"]) >= old_date && item["type"] == "opened"
if item["is_pr"]
push!(contributors, item["user"])
prs_opened += 1
else
issues_opened += 1
end
end
end
println("""
Downloads : >$n_downloads
Pull requests opened : $prs_opened
Issues opened : $issues_opened
Unique contributors : $(length(contributors))
""")
return
end

has_arg(arg) = any(isequal(arg), ARGS)

if has_arg("--update")
update_download_statistics()
update_package_statistics()
update_contributor_prs_over_time()
state_of_jump_statistics()
end