Skip to content

Commit

Permalink
Add summary statistics to webpage (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Jul 16, 2024
1 parent af171fe commit fdefb5a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/assets/repositories.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ function rolling_average(dates, requests, window = 28) {
"range": ["2013-01-01", to_date(new Date())],
"title": "Count"
}
}
}
load_json("summary.json", function (data) {
Object.keys(data).map(function (key) {
document.getElementById(key).textContent = data[key]
});
});
load_json("download_stats.json", function (data) {
var chart = d3.select('#chart_download_statistics').node();
visible = new Set(["JuMP.jl", "HiGHS.jl"]);
Expand Down
12 changes: 12 additions & 0 deletions docs/repositories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ <h2>Repository activity</h2>
We also track <a href="../index.html">performance benchmarks</a>.
</p>
<div class="divider"></div>
<div class="small-text">
<p>
In the last 12 months of jump-dev, there have been:
<ul>
<li>at least <span id="n_downloads"></span> downloads of packages, as measured by Julia's package servers and excluding CI jobs</li>
<li><span id="prs_opened"></span> pull requests opened</li>
<li><span id="issues_opened"></span> issues opened</li>
<li><span id="num_contributors"></span> unique contributors who have opened a PR</li>
</ul>
</p>
</div>
<div class="divider"></div>
<ol class="small-text">
<li><a href="#chart_download_statistics">User downloads by package</a></li>
<li><a href="#chart_pr_activity">Pull request activity by month</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/repositories/summary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"issues_opened":373,"n_downloads":694977,"prs_opened":1174,"num_contributors":52}
10 changes: 10 additions & 0 deletions scripts/repositories.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ function state_of_jump_statistics()
end
end
end
open(joinpath(DATA_DIR, "summary.json"), "w") do io
summary = Dict(
"n_downloads" => n_downloads,
"prs_opened" => prs_opened,
"issues_opened" => issues_opened,
"num_contributors" => length(contributors),
)
write(io, JSON.json(summary))
return
end
println("""
Downloads : >$n_downloads
Pull requests opened : $prs_opened
Expand Down

0 comments on commit fdefb5a

Please sign in to comment.