{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/shielddash/pulls/comments/61919641","id":61919641,"diff_hunk":"@@ -0,0 +1,93 @@\n+import datetime\n+from operator import itemgetter\n+\n+import ujson\n+from moztelemetry import get_pings\n+\n+\n+PING_NAME = 'x-shield-studies'\n+HEARTBEAT_NAME = 'x-shield-study-performance-1'\n+STUDY_NAME = 'screen Performance X1'\n+STUDY_START = '20160325'\n+TODAY = datetime.date.today().strftime('%Y%m%d')\n+\n+\n+def getShieldProps(p):\n+    out = {\n+        'client_id': p.get('clientId'),\n+        'channel': p['application']['channel'],\n+        'creation_date': datetime.datetime.utcfromtimestamp(\n+            long(p['meta']['creationTimestamp']) // 1e9),\n+        'doc_type': p['meta']['docType']\n+    }\n+    for k in ['firstrun', 'msg', 'name', 'variation']:\n+        if k == 'firstrun':\n+            out[k] = datetime.datetime.utcfromtimestamp(\n+                int(p['payload'][k]) // 1e3)\n+        else:\n+            out[k] = p['payload'][k]\n+    return out","path":"notebooks/shield-dash-import.py","position":29,"original_position":29,"commit_id":"01f069fb4c63b4b1d137738697af737060043675","original_commit_id":"01f069fb4c63b4b1d137738697af737060043675","user":{"login":"robhudson","id":1106,"avatar_url":"https://avatars.githubusercontent.com/u/1106?v=3","gravatar_id":"","url":"https://api.github.com/users/robhudson","html_url":"https://github.com/robhudson","followers_url":"https://api.github.com/users/robhudson/followers","following_url":"https://api.github.com/users/robhudson/following{/other_user}","gists_url":"https://api.github.com/users/robhudson/gists{/gist_id}","starred_url":"https://api.github.com/users/robhudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robhudson/subscriptions","organizations_url":"https://api.github.com/users/robhudson/orgs","repos_url":"https://api.github.com/users/robhudson/repos","events_url":"https://api.github.com/users/robhudson/events{/privacy}","received_events_url":"https://api.github.com/users/robhudson/received_events","type":"User","site_admin":false},"body":"@jezdez I tried to make the date math a bit nicer here. Let me know what you think.","created_at":"2016-05-03T17:19:35Z","updated_at":"2016-05-03T17:19:35Z","html_url":"https://github.com/mozilla/shielddash/pull/2#discussion_r61919641","pull_request_url":"https://api.github.com/repos/mozilla/shielddash/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/mozilla/shielddash/pulls/comments/61919641"},"html":{"href":"https://github.com/mozilla/shielddash/pull/2#discussion_r61919641"},"pull_request":{"href":"https://api.github.com/repos/mozilla/shielddash/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/shielddash/pulls/2","id":68141972,"html_url":"https://github.com/mozilla/shielddash/pull/2","diff_url":"https://github.com/mozilla/shielddash/pull/2.diff","patch_url":"https://github.com/mozilla/shielddash/pull/2.patch","issue_url":"https://api.github.com/repos/mozilla/shielddash/issues/2","number":2,"state":"open","locked":false,"title":"Add python notebook for shield data collection","user":{"login":"robhudson","id":1106,"avatar_url":"https://avatars.githubusercontent.com/u/1106?v=3","gravatar_id":"","url":"https://api.github.com/users/robhudson","html_url":"https://github.com/robhudson","followers_url":"https://api.github.com/users/robhudson/followers","following_url":"https://api.github.com/users/robhudson/following{/other_user}","gists_url":"https://api.github.com/users/robhudson/gists{/gist_id}","starred_url":"https://api.github.com/users/robhudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robhudson/subscriptions","organizations_url":"https://api.github.com/users/robhudson/orgs","repos_url":"https://api.github.com/users/robhudson/repos","events_url":"https://api.github.com/users/robhudson/events{/privacy}","received_events_url":"https://api.github.com/users/robhudson/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-27T23:30:26Z","updated_at":"2016-05-03T17:19:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10c24f97949833d0257d9c049a6f844680207ca1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/shielddash/pulls/2/commits","review_comments_url":"https://api.github.com/repos/mozilla/shielddash/pulls/2/comments","review_comment_url":"https://api.github.com/repos/mozilla/shielddash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/shielddash/issues/2/comments","statuses_url":"https://api.github.com/repos/mozilla/shielddash/statuses/01f069fb4c63b4b1d137738697af737060043675","head":{"label":"mozilla:ipynb-job","ref":"ipynb-job","sha":"01f069fb4c63b4b1d137738697af737060043675","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":57143883,"name":"shielddash","full_name":"mozilla/shielddash","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/shielddash","description":"Dashboard for SHIELD study reports.","fork":false,"url":"https://api.github.com/repos/mozilla/shielddash","forks_url":"https://api.github.com/repos/mozilla/shielddash/forks","keys_url":"https://api.github.com/repos/mozilla/shielddash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/shielddash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/shielddash/teams","hooks_url":"https://api.github.com/repos/mozilla/shielddash/hooks","issue_events_url":"https://api.github.com/repos/mozilla/shielddash/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/shielddash/events","assignees_url":"https://api.github.com/repos/mozilla/shielddash/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/shielddash/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/shielddash/tags","blobs_url":"https://api.github.com/repos/mozilla/shielddash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/shielddash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/shielddash/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/shielddash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/shielddash/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/shielddash/languages","stargazers_url":"https://api.github.com/repos/mozilla/shielddash/stargazers","contributors_url":"https://api.github.com/repos/mozilla/shielddash/contributors","subscribers_url":"https://api.github.com/repos/mozilla/shielddash/subscribers","subscription_url":"https://api.github.com/repos/mozilla/shielddash/subscription","commits_url":"https://api.github.com/repos/mozilla/shielddash/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/shielddash/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/shielddash/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/shielddash/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/shielddash/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/shielddash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/shielddash/merges","archive_url":"https://api.github.com/repos/mozilla/shielddash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/shielddash/downloads","issues_url":"https://api.github.com/repos/mozilla/shielddash/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/shielddash/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/shielddash/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/shielddash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/shielddash/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/shielddash/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/shielddash/deployments","created_at":"2016-04-26T16:22:20Z","updated_at":"2016-05-02T16:29:08Z","pushed_at":"2016-05-03T16:42:15Z","git_url":"git://github.com/mozilla/shielddash.git","ssh_url":"git@github.com:mozilla/shielddash.git","clone_url":"https://github.com/mozilla/shielddash.git","svn_url":"https://github.com/mozilla/shielddash","homepage":null,"size":19,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"5e2a20440d152e8ef80f05468a88219c6b0c6dea","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":57143883,"name":"shielddash","full_name":"mozilla/shielddash","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/shielddash","description":"Dashboard for SHIELD study reports.","fork":false,"url":"https://api.github.com/repos/mozilla/shielddash","forks_url":"https://api.github.com/repos/mozilla/shielddash/forks","keys_url":"https://api.github.com/repos/mozilla/shielddash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/shielddash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/shielddash/teams","hooks_url":"https://api.github.com/repos/mozilla/shielddash/hooks","issue_events_url":"https://api.github.com/repos/mozilla/shielddash/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/shielddash/events","assignees_url":"https://api.github.com/repos/mozilla/shielddash/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/shielddash/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/shielddash/tags","blobs_url":"https://api.github.com/repos/mozilla/shielddash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/shielddash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/shielddash/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/shielddash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/shielddash/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/shielddash/languages","stargazers_url":"https://api.github.com/repos/mozilla/shielddash/stargazers","contributors_url":"https://api.github.com/repos/mozilla/shielddash/contributors","subscribers_url":"https://api.github.com/repos/mozilla/shielddash/subscribers","subscription_url":"https://api.github.com/repos/mozilla/shielddash/subscription","commits_url":"https://api.github.com/repos/mozilla/shielddash/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/shielddash/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/shielddash/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/shielddash/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/shielddash/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/shielddash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/shielddash/merges","archive_url":"https://api.github.com/repos/mozilla/shielddash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/shielddash/downloads","issues_url":"https://api.github.com/repos/mozilla/shielddash/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/shielddash/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/shielddash/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/shielddash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/shielddash/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/shielddash/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/shielddash/deployments","created_at":"2016-04-26T16:22:20Z","updated_at":"2016-05-02T16:29:08Z","pushed_at":"2016-05-03T16:42:15Z","git_url":"git://github.com/mozilla/shielddash.git","ssh_url":"git@github.com:mozilla/shielddash.git","clone_url":"https://github.com/mozilla/shielddash.git","svn_url":"https://github.com/mozilla/shielddash","homepage":null,"size":19,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/shielddash/pulls/2"},"html":{"href":"https://github.com/mozilla/shielddash/pull/2"},"issue":{"href":"https://api.github.com/repos/mozilla/shielddash/issues/2"},"comments":{"href":"https://api.github.com/repos/mozilla/shielddash/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/shielddash/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/shielddash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/shielddash/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/shielddash/statuses/01f069fb4c63b4b1d137738697af737060043675"}}}}