{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/socorro/pulls/comments/35795392","id":35795392,"diff_hunk":"@@ -0,0 +1,143 @@\n+# This Source Code Form is subject to the terms of the Mozilla Public\n+# License, v. 2.0. If a copy of the MPL was not distributed with this\n+# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n+\n+import datetime\n+\n+from nose.plugins.attrib import attr\n+from nose.tools import eq_, assert_raises\n+\n+from socorro.external.postgresql.adi import ADI\n+from socorro.external import MissingArgumentError\n+\n+from unittestbase import PostgreSQLTestCase\n+\n+\n+@attr(integration='postgres')  # for nosetests\n+class IntegrationTestADI(PostgreSQLTestCase):\n+\n+    def setUp(self):\n+        \"\"\"Set up this test class by populating the reports table with fake\n+        data. \"\"\"\n+        super(IntegrationTestADI, self).setUp()\n+        self._truncate()\n+        cursor = self.connection.cursor()\n+\n+        self.date = datetime.datetime(2015, 7, 1)\n+        yesterday = self.date.replace(hour=0) - datetime.timedelta(hours=24)","path":"socorro/unittest/external/postgresql/test_adi.py","position":27,"original_position":27,"commit_id":"a0305cfb8e4bd01652d581ae93a6782974ac9e78","original_commit_id":"a0305cfb8e4bd01652d581ae93a6782974ac9e78","user":{"login":"AdrianGaudebert","id":328790,"avatar_url":"https://avatars.githubusercontent.com/u/328790?v=3","gravatar_id":"","url":"https://api.github.com/users/AdrianGaudebert","html_url":"https://github.com/AdrianGaudebert","followers_url":"https://api.github.com/users/AdrianGaudebert/followers","following_url":"https://api.github.com/users/AdrianGaudebert/following{/other_user}","gists_url":"https://api.github.com/users/AdrianGaudebert/gists{/gist_id}","starred_url":"https://api.github.com/users/AdrianGaudebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdrianGaudebert/subscriptions","organizations_url":"https://api.github.com/users/AdrianGaudebert/orgs","repos_url":"https://api.github.com/users/AdrianGaudebert/repos","events_url":"https://api.github.com/users/AdrianGaudebert/events{/privacy}","received_events_url":"https://api.github.com/users/AdrianGaudebert/received_events","type":"User","site_admin":false},"body":"Why do you need ``.replace(hour=0)``? It should already be ``0`` since you didn't pass a value for the ``hour`` param when you created it. And also, why not just make it a ``datetime.date`` object? ","created_at":"2015-07-29T18:35:23Z","updated_at":"2015-07-29T18:35:23Z","html_url":"https://github.com/mozilla/socorro/pull/2907#discussion_r35795392","pull_request_url":"https://api.github.com/repos/mozilla/socorro/pulls/2907","_links":{"self":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/comments/35795392"},"html":{"href":"https://github.com/mozilla/socorro/pull/2907#discussion_r35795392"},"pull_request":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2907"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/socorro/pulls/2907","id":40592868,"html_url":"https://github.com/mozilla/socorro/pull/2907","diff_url":"https://github.com/mozilla/socorro/pull/2907.diff","patch_url":"https://github.com/mozilla/socorro/pull/2907.patch","issue_url":"https://api.github.com/repos/mozilla/socorro/issues/2907","number":2907,"state":"open","locked":false,"title":"fixes bug 1186512 - Expose raw ADI counts","user":{"login":"peterbe","id":26739,"avatar_url":"https://avatars.githubusercontent.com/u/26739?v=3","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"body":"@rhelmer r? (informal)\r\n\r\nRob, I just wanted to share what I've got so far. \r\nAgain, here's an example of its use: https://gist.github.com/peterbe/843ec4764e39dc6a364d\r\n\r\nThe reason I'm not treading with confidence is because I'm not entirely sure how I'm going to need this to work. My objective is to pull in data from this into the webapp and use SuperSearch aggregates to combine crash counts with ADI. In particular for the sake of the /daily report. I haven't yet started looking at throttle values. ","created_at":"2015-07-22T17:55:20Z","updated_at":"2015-07-29T18:35:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49e2bcc6e0d27a538d1afcf2486dbe1ed89492f5","assignee":{"login":"rhelmer","id":61412,"avatar_url":"https://avatars.githubusercontent.com/u/61412?v=3","gravatar_id":"","url":"https://api.github.com/users/rhelmer","html_url":"https://github.com/rhelmer","followers_url":"https://api.github.com/users/rhelmer/followers","following_url":"https://api.github.com/users/rhelmer/following{/other_user}","gists_url":"https://api.github.com/users/rhelmer/gists{/gist_id}","starred_url":"https://api.github.com/users/rhelmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhelmer/subscriptions","organizations_url":"https://api.github.com/users/rhelmer/orgs","repos_url":"https://api.github.com/users/rhelmer/repos","events_url":"https://api.github.com/users/rhelmer/events{/privacy}","received_events_url":"https://api.github.com/users/rhelmer/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/socorro/pulls/2907/commits","review_comments_url":"https://api.github.com/repos/mozilla/socorro/pulls/2907/comments","review_comment_url":"https://api.github.com/repos/mozilla/socorro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/socorro/issues/2907/comments","statuses_url":"https://api.github.com/repos/mozilla/socorro/statuses/a0305cfb8e4bd01652d581ae93a6782974ac9e78","head":{"label":"peterbe:bug-1186512-expose-raw-adi-counts","ref":"bug-1186512-expose-raw-adi-counts","sha":"a0305cfb8e4bd01652d581ae93a6782974ac9e78","user":{"login":"peterbe","id":26739,"avatar_url":"https://avatars.githubusercontent.com/u/26739?v=3","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"repo":{"id":2920665,"name":"socorro","full_name":"peterbe/socorro","owner":{"login":"peterbe","id":26739,"avatar_url":"https://avatars.githubusercontent.com/u/26739?v=3","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peterbe/socorro","description":"Socorro is a server to accept and process Breakpad crash reports. ","fork":true,"url":"https://api.github.com/repos/peterbe/socorro","forks_url":"https://api.github.com/repos/peterbe/socorro/forks","keys_url":"https://api.github.com/repos/peterbe/socorro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peterbe/socorro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peterbe/socorro/teams","hooks_url":"https://api.github.com/repos/peterbe/socorro/hooks","issue_events_url":"https://api.github.com/repos/peterbe/socorro/issues/events{/number}","events_url":"https://api.github.com/repos/peterbe/socorro/events","assignees_url":"https://api.github.com/repos/peterbe/socorro/assignees{/user}","branches_url":"https://api.github.com/repos/peterbe/socorro/branches{/branch}","tags_url":"https://api.github.com/repos/peterbe/socorro/tags","blobs_url":"https://api.github.com/repos/peterbe/socorro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peterbe/socorro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peterbe/socorro/git/refs{/sha}","trees_url":"https://api.github.com/repos/peterbe/socorro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peterbe/socorro/statuses/{sha}","languages_url":"https://api.github.com/repos/peterbe/socorro/languages","stargazers_url":"https://api.github.com/repos/peterbe/socorro/stargazers","contributors_url":"https://api.github.com/repos/peterbe/socorro/contributors","subscribers_url":"https://api.github.com/repos/peterbe/socorro/subscribers","subscription_url":"https://api.github.com/repos/peterbe/socorro/subscription","commits_url":"https://api.github.com/repos/peterbe/socorro/commits{/sha}","git_commits_url":"https://api.github.com/repos/peterbe/socorro/git/commits{/sha}","comments_url":"https://api.github.com/repos/peterbe/socorro/comments{/number}","issue_comment_url":"https://api.github.com/repos/peterbe/socorro/issues/comments{/number}","contents_url":"https://api.github.com/repos/peterbe/socorro/contents/{+path}","compare_url":"https://api.github.com/repos/peterbe/socorro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peterbe/socorro/merges","archive_url":"https://api.github.com/repos/peterbe/socorro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peterbe/socorro/downloads","issues_url":"https://api.github.com/repos/peterbe/socorro/issues{/number}","pulls_url":"https://api.github.com/repos/peterbe/socorro/pulls{/number}","milestones_url":"https://api.github.com/repos/peterbe/socorro/milestones{/number}","notifications_url":"https://api.github.com/repos/peterbe/socorro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peterbe/socorro/labels{/name}","releases_url":"https://api.github.com/repos/peterbe/socorro/releases{/id}","created_at":"2011-12-05T23:07:30Z","updated_at":"2014-06-24T00:26:16Z","pushed_at":"2015-07-29T17:52:49Z","git_url":"git://github.com/peterbe/socorro.git","ssh_url":"git@github.com:peterbe/socorro.git","clone_url":"https://github.com/peterbe/socorro.git","svn_url":"https://github.com/peterbe/socorro","homepage":"https://wiki.mozilla.org/Socorro","size":163970,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"5d8f6793a1e79935e7373fb04d12ee73ace37dfe","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":2263742,"name":"socorro","full_name":"mozilla/socorro","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/socorro","description":"Socorro is a server to accept and process Breakpad crash reports. ","fork":false,"url":"https://api.github.com/repos/mozilla/socorro","forks_url":"https://api.github.com/repos/mozilla/socorro/forks","keys_url":"https://api.github.com/repos/mozilla/socorro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/socorro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/socorro/teams","hooks_url":"https://api.github.com/repos/mozilla/socorro/hooks","issue_events_url":"https://api.github.com/repos/mozilla/socorro/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/socorro/events","assignees_url":"https://api.github.com/repos/mozilla/socorro/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/socorro/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/socorro/tags","blobs_url":"https://api.github.com/repos/mozilla/socorro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/socorro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/socorro/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/socorro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/socorro/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/socorro/languages","stargazers_url":"https://api.github.com/repos/mozilla/socorro/stargazers","contributors_url":"https://api.github.com/repos/mozilla/socorro/contributors","subscribers_url":"https://api.github.com/repos/mozilla/socorro/subscribers","subscription_url":"https://api.github.com/repos/mozilla/socorro/subscription","commits_url":"https://api.github.com/repos/mozilla/socorro/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/socorro/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/socorro/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/socorro/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/socorro/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/socorro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/socorro/merges","archive_url":"https://api.github.com/repos/mozilla/socorro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/socorro/downloads","issues_url":"https://api.github.com/repos/mozilla/socorro/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/socorro/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/socorro/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/socorro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/socorro/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/socorro/releases{/id}","created_at":"2011-08-24T19:21:49Z","updated_at":"2015-07-27T07:28:39Z","pushed_at":"2015-07-29T16:30:32Z","git_url":"git://github.com/mozilla/socorro.git","ssh_url":"git@github.com:mozilla/socorro.git","clone_url":"https://github.com/mozilla/socorro.git","svn_url":"https://github.com/mozilla/socorro","homepage":"https://wiki.mozilla.org/Socorro","size":191948,"stargazers_count":234,"watchers_count":234,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":123,"mirror_url":null,"open_issues_count":9,"forks":123,"open_issues":9,"watchers":234,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2907"},"html":{"href":"https://github.com/mozilla/socorro/pull/2907"},"issue":{"href":"https://api.github.com/repos/mozilla/socorro/issues/2907"},"comments":{"href":"https://api.github.com/repos/mozilla/socorro/issues/2907/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2907/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2907/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/socorro/statuses/a0305cfb8e4bd01652d581ae93a6782974ac9e78"}}}}