Created
January 2, 2016 16:49
-
-
Save jakobw/83f61dab211b61dbc358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'github_api' | |
github = Github.new | |
prs = github.pull_requests(user: 'Zarel', repo: 'Pokemon-Showdown') | |
.all(state: 'all', per_page: 100) | |
.auto_paginate(true) | |
known_authors = [] | |
rejected = 0 | |
multi_pr = [] | |
time_to_merge = [] | |
prs.each do |pr| | |
if pr.merged_at | |
time_to_merge << (DateTime.parse(pr.merged_at).to_time - DateTime.parse(pr.created_at).to_time) / 3600 | |
end | |
if known_authors.include?(pr.user.login) | |
multi_pr << pr.user.login | |
next | |
end | |
known_authors << pr.user.login | |
rejected += 1 unless pr.merged_at | |
end | |
avg_ttm = time_to_merge.reduce(&:+) / 1529.0 | |
puts "All authors: #{known_authors.length}" | |
puts "Rejected: #{rejected}" | |
puts "Accepted: #{known_authors.length - rejected}" | |
puts "Multiple PR: #{multi_pr.uniq.length}" | |
puts "First time avg hours to merge: #{avg_ttm}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment