Skip to content

Instantly share code, notes, and snippets.

View Elchi3's full-sized avatar

Florian Scholz Elchi3

View GitHub Profile
@hoosteeno
hoosteeno / core_contrib_analysis.sql
Last active January 14, 2016 23:47
Get number of contribs, number of revisions per contrib, and percentage of contribution for those contribs using last 3 months activity to identify contribs.
SELECT count(username) AS num_contribs,
group_concat(username, ' (', user_total_revisions, ' revisions)' separator ', ') AS contribs,
sum(user_total_revisions) AS revisions_by_these_contribs,
overall_total_revisions,
(sum(user_total_revisions) / overall_total_revisions * 100) AS percentage_revisions_by_these_contribs
FROM (
/* get usernames WITH X revisions IN ANY month OF the last 3, AND Y revisions overall IN the last 3 */