{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/214969721","pull_request_review_id":152133846,"id":214969721,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDk2OTcyMQ==","diff_hunk":"@@ -0,0 +1,31 @@\n+#!/usr/bin/env python\n+\n+import requests\n+\n+from datetime import datetime\n+\n+\n+def created_at(pull_request):\n+    # String format can parse: 2018-01-29T16:23:55Z, 2018-08-17T08:41:36Z\n+    return datetime.strptime(pull_request['created_at'], '%Y-%m-%dT%H:%M:%SZ')\n+\n+\n+def main():\n+    uri = 'https://api.github.com/repos/mesosphere/marathon/pulls'\n+    content = requests.get(uri, params={'state':'open'}).json()\n+    now = datetime.now()\n+    ages = [now - created_at(pull_request) for pull_request in content]\n+\n+    ages = sorted(ages)\n+    p50_index = int(len(ages) * 0.5)\n+    p90_index = int(len(ages) * 0.9)\n+\n+    print(\"In {:d} pull requests\".format(len(ages)))\n+    print(\"Min:\", min(ages))","path":"tools/github_pulls_stats.py","position":24,"original_position":24,"commit_id":"159ae9a485566b09fc2e1f0d75c3d5a609102e95","original_commit_id":"159ae9a485566b09fc2e1f0d75c3d5a609102e95","user":{"login":"ichernetsky","id":96977,"node_id":"MDQ6VXNlcjk2OTc3","avatar_url":"https://avatars1.githubusercontent.com/u/96977?v=4","gravatar_id":"","url":"https://api.github.com/users/ichernetsky","html_url":"https://github.com/ichernetsky","followers_url":"https://api.github.com/users/ichernetsky/followers","following_url":"https://api.github.com/users/ichernetsky/following{/other_user}","gists_url":"https://api.github.com/users/ichernetsky/gists{/gist_id}","starred_url":"https://api.github.com/users/ichernetsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichernetsky/subscriptions","organizations_url":"https://api.github.com/users/ichernetsky/orgs","repos_url":"https://api.github.com/users/ichernetsky/repos","events_url":"https://api.github.com/users/ichernetsky/events{/privacy}","received_events_url":"https://api.github.com/users/ichernetsky/received_events","type":"User","site_admin":false},"body":"Can be just `ages[0]`","created_at":"2018-09-04T15:50:11Z","updated_at":"2018-09-04T15:50:27Z","html_url":"https://github.com/mesosphere/marathon/pull/6499#discussion_r214969721","pull_request_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6499","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/214969721"},"html":{"href":"https://github.com/mesosphere/marathon/pull/6499#discussion_r214969721"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6499"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/6499","id":212381786,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMzgxNzg2","html_url":"https://github.com/mesosphere/marathon/pull/6499","diff_url":"https://github.com/mesosphere/marathon/pull/6499.diff","patch_url":"https://github.com/mesosphere/marathon/pull/6499.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/6499","number":6499,"state":"open","locked":false,"title":"Create GitHub pull requests statistics.","user":{"login":"jeschkies","id":2418440,"node_id":"MDQ6VXNlcjI0MTg0NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2418440?v=4","gravatar_id":"","url":"https://api.github.com/users/jeschkies","html_url":"https://github.com/jeschkies","followers_url":"https://api.github.com/users/jeschkies/followers","following_url":"https://api.github.com/users/jeschkies/following{/other_user}","gists_url":"https://api.github.com/users/jeschkies/gists{/gist_id}","starred_url":"https://api.github.com/users/jeschkies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeschkies/subscriptions","organizations_url":"https://api.github.com/users/jeschkies/orgs","repos_url":"https://api.github.com/users/jeschkies/repos","events_url":"https://api.github.com/users/jeschkies/events{/privacy}","received_events_url":"https://api.github.com/users/jeschkies/received_events","type":"User","site_admin":false},"body":"Summary:\r\nWe want to move faster and reduce the number of our pull requests. Our\r\nfirst step is to generate data and get an overview. The Python script\r\n`ci/github_pulls_stats.py` gets the list of pull requests and calculates\r\nthe youngest, oldest, p50 and p90 open pull request.","created_at":"2018-08-31T13:22:35Z","updated_at":"2018-09-04T15:50:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d8b40c6e9fba44bc319c65d2af0c1b9e5a1c6b5","assignee":null,"assignees":[],"requested_reviewers":[{"login":"kensipe","id":27497,"node_id":"MDQ6VXNlcjI3NDk3","avatar_url":"https://avatars2.githubusercontent.com/u/27497?v=4","gravatar_id":"","url":"https://api.github.com/users/kensipe","html_url":"https://github.com/kensipe","followers_url":"https://api.github.com/users/kensipe/followers","following_url":"https://api.github.com/users/kensipe/following{/other_user}","gists_url":"https://api.github.com/users/kensipe/gists{/gist_id}","starred_url":"https://api.github.com/users/kensipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kensipe/subscriptions","organizations_url":"https://api.github.com/users/kensipe/orgs","repos_url":"https://api.github.com/users/kensipe/repos","events_url":"https://api.github.com/users/kensipe/events{/privacy}","received_events_url":"https://api.github.com/users/kensipe/received_events","type":"User","site_admin":false},{"login":"meln1k","id":1043441,"node_id":"MDQ6VXNlcjEwNDM0NDE=","avatar_url":"https://avatars1.githubusercontent.com/u/1043441?v=4","gravatar_id":"","url":"https://api.github.com/users/meln1k","html_url":"https://github.com/meln1k","followers_url":"https://api.github.com/users/meln1k/followers","following_url":"https://api.github.com/users/meln1k/following{/other_user}","gists_url":"https://api.github.com/users/meln1k/gists{/gist_id}","starred_url":"https://api.github.com/users/meln1k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meln1k/subscriptions","organizations_url":"https://api.github.com/users/meln1k/orgs","repos_url":"https://api.github.com/users/meln1k/repos","events_url":"https://api.github.com/users/meln1k/events{/privacy}","received_events_url":"https://api.github.com/users/meln1k/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6499/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6499/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/6499/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/159ae9a485566b09fc2e1f0d75c3d5a609102e95","head":{"label":"mesosphere:karsten/pulls-stats","ref":"karsten/pulls-stats","sha":"159ae9a485566b09fc2e1f0d75c3d5a609102e95","user":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk0MTQwOQ==","name":"marathon","full_name":"mesosphere/marathon","owner":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2018-09-04T13:04:47Z","pushed_at":"2018-09-04T14:12:44Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":37957,"stargazers_count":3718,"watchers_count":3718,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":851,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":851,"open_issues":22,"watchers":3718,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"085ba318d06d1fceb87f8c0ac4df1a7302cd7169","user":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk0MTQwOQ==","name":"marathon","full_name":"mesosphere/marathon","owner":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2018-09-04T13:04:47Z","pushed_at":"2018-09-04T14:12:44Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":37957,"stargazers_count":3718,"watchers_count":3718,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":851,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":851,"open_issues":22,"watchers":3718,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6499"},"html":{"href":"https://github.com/mesosphere/marathon/pull/6499"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/6499"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/6499/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6499/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6499/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon/statuses/159ae9a485566b09fc2e1f0d75c3d5a609102e95"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ichernetsky"}}