{"action":"created","comment":{"url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments/37543635","id":37543635,"diff_hunk":"@@ -0,0 +1,96 @@\n+import datetime\n+\n+import requests\n+\n+from django.conf import settings\n+from tld import get_tld\n+\n+class Graphite:\n+    def get_uptime(self, metric, limit):\n+        try:\n+            uptime_values = requests.get(\n+                'http://metrics.presslabs.net/render/?'\n+                'target=limit(asPercent(' + metric + ',1),' + limit + ')'\n+                '&format=json&from=-1h',\n+                auth=(settings.METRICS_USERNAME, settings.METRICS_PASSWORD)\n+            ).json()\n+            sum_items = 0\n+            count = 0\n+            for item in uptime_values:\n+                for provider_data in item['datapoints']:\n+                    sum_items += (provider_data[0] or 0)\n+                    count = count + 1\n+            return format(float(sum_items / count), '.2f')\n+        except:","path":"src/dashboard/functions.py","position":24,"original_position":24,"commit_id":"30b968f16ad9eea4f1bfcdb3d9a2e47cbd8685b8","original_commit_id":"30b968f16ad9eea4f1bfcdb3d9a2e47cbd8685b8","user":{"login":"vtemian","id":639771,"avatar_url":"https://avatars.githubusercontent.com/u/639771?v=3","gravatar_id":"","url":"https://api.github.com/users/vtemian","html_url":"https://github.com/vtemian","followers_url":"https://api.github.com/users/vtemian/followers","following_url":"https://api.github.com/users/vtemian/following{/other_user}","gists_url":"https://api.github.com/users/vtemian/gists{/gist_id}","starred_url":"https://api.github.com/users/vtemian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtemian/subscriptions","organizations_url":"https://api.github.com/users/vtemian/orgs","repos_url":"https://api.github.com/users/vtemian/repos","events_url":"https://api.github.com/users/vtemian/events{/privacy}","received_events_url":"https://api.github.com/users/vtemian/received_events","type":"User","site_admin":false},"body":"Don't use pokemon exceptions","created_at":"2015-08-20T15:31:25Z","updated_at":"2015-08-20T15:31:25Z","html_url":"https://github.com/PressLabs/presswise-ng/pull/86#discussion_r37543635","pull_request_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments/37543635"},"html":{"href":"https://github.com/PressLabs/presswise-ng/pull/86#discussion_r37543635"},"pull_request":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86","id":42582608,"html_url":"https://github.com/PressLabs/presswise-ng/pull/86","diff_url":"https://github.com/PressLabs/presswise-ng/pull/86.diff","patch_url":"https://github.com/PressLabs/presswise-ng/pull/86.patch","issue_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/86","number":86,"state":"open","locked":false,"title":"78 comparing","user":{"login":"Cozloschi","id":8299041,"avatar_url":"https://avatars.githubusercontent.com/u/8299041?v=3","gravatar_id":"","url":"https://api.github.com/users/Cozloschi","html_url":"https://github.com/Cozloschi","followers_url":"https://api.github.com/users/Cozloschi/followers","following_url":"https://api.github.com/users/Cozloschi/following{/other_user}","gists_url":"https://api.github.com/users/Cozloschi/gists{/gist_id}","starred_url":"https://api.github.com/users/Cozloschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cozloschi/subscriptions","organizations_url":"https://api.github.com/users/Cozloschi/orgs","repos_url":"https://api.github.com/users/Cozloschi/repos","events_url":"https://api.github.com/users/Cozloschi/events{/privacy}","received_events_url":"https://api.github.com/users/Cozloschi/received_events","type":"User","site_admin":false},"body":"@vtemian ","created_at":"2015-08-17T12:30:05Z","updated_at":"2015-08-20T15:31:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3cf511f4ee07cea4e1f0f0445d9f74a6aea334f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86/commits","review_comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86/comments","review_comment_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/86/comments","statuses_url":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/30b968f16ad9eea4f1bfcdb3d9a2e47cbd8685b8","head":{"label":"PressLabs:78-comparing","ref":"78-comparing","sha":"30b968f16ad9eea4f1bfcdb3d9a2e47cbd8685b8","user":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":38364073,"name":"presswise-ng","full_name":"PressLabs/presswise-ng","owner":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PressLabs/presswise-ng","description":"The next generation of PressWise","fork":false,"url":"https://api.github.com/repos/PressLabs/presswise-ng","forks_url":"https://api.github.com/repos/PressLabs/presswise-ng/forks","keys_url":"https://api.github.com/repos/PressLabs/presswise-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PressLabs/presswise-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PressLabs/presswise-ng/teams","hooks_url":"https://api.github.com/repos/PressLabs/presswise-ng/hooks","issue_events_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/events{/number}","events_url":"https://api.github.com/repos/PressLabs/presswise-ng/events","assignees_url":"https://api.github.com/repos/PressLabs/presswise-ng/assignees{/user}","branches_url":"https://api.github.com/repos/PressLabs/presswise-ng/branches{/branch}","tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/tags","blobs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/PressLabs/presswise-ng/languages","stargazers_url":"https://api.github.com/repos/PressLabs/presswise-ng/stargazers","contributors_url":"https://api.github.com/repos/PressLabs/presswise-ng/contributors","subscribers_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscribers","subscription_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscription","commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/PressLabs/presswise-ng/contents/{+path}","compare_url":"https://api.github.com/repos/PressLabs/presswise-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PressLabs/presswise-ng/merges","archive_url":"https://api.github.com/repos/PressLabs/presswise-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PressLabs/presswise-ng/downloads","issues_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues{/number}","pulls_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/PressLabs/presswise-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/PressLabs/presswise-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PressLabs/presswise-ng/labels{/name}","releases_url":"https://api.github.com/repos/PressLabs/presswise-ng/releases{/id}","created_at":"2015-07-01T10:05:16Z","updated_at":"2015-07-31T10:06:33Z","pushed_at":"2015-08-20T13:17:11Z","git_url":"git://github.com/PressLabs/presswise-ng.git","ssh_url":"git@github.com:PressLabs/presswise-ng.git","clone_url":"https://github.com/PressLabs/presswise-ng.git","svn_url":"https://github.com/PressLabs/presswise-ng","homepage":null,"size":1365,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"PressLabs:master","ref":"master","sha":"c32dbf0af45167d599b2a134de0badb1cc042866","user":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":38364073,"name":"presswise-ng","full_name":"PressLabs/presswise-ng","owner":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PressLabs/presswise-ng","description":"The next generation of PressWise","fork":false,"url":"https://api.github.com/repos/PressLabs/presswise-ng","forks_url":"https://api.github.com/repos/PressLabs/presswise-ng/forks","keys_url":"https://api.github.com/repos/PressLabs/presswise-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PressLabs/presswise-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PressLabs/presswise-ng/teams","hooks_url":"https://api.github.com/repos/PressLabs/presswise-ng/hooks","issue_events_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/events{/number}","events_url":"https://api.github.com/repos/PressLabs/presswise-ng/events","assignees_url":"https://api.github.com/repos/PressLabs/presswise-ng/assignees{/user}","branches_url":"https://api.github.com/repos/PressLabs/presswise-ng/branches{/branch}","tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/tags","blobs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/PressLabs/presswise-ng/languages","stargazers_url":"https://api.github.com/repos/PressLabs/presswise-ng/stargazers","contributors_url":"https://api.github.com/repos/PressLabs/presswise-ng/contributors","subscribers_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscribers","subscription_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscription","commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/PressLabs/presswise-ng/contents/{+path}","compare_url":"https://api.github.com/repos/PressLabs/presswise-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PressLabs/presswise-ng/merges","archive_url":"https://api.github.com/repos/PressLabs/presswise-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PressLabs/presswise-ng/downloads","issues_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues{/number}","pulls_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/PressLabs/presswise-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/PressLabs/presswise-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PressLabs/presswise-ng/labels{/name}","releases_url":"https://api.github.com/repos/PressLabs/presswise-ng/releases{/id}","created_at":"2015-07-01T10:05:16Z","updated_at":"2015-07-31T10:06:33Z","pushed_at":"2015-08-20T13:17:11Z","git_url":"git://github.com/PressLabs/presswise-ng.git","ssh_url":"git@github.com:PressLabs/presswise-ng.git","clone_url":"https://github.com/PressLabs/presswise-ng.git","svn_url":"https://github.com/PressLabs/presswise-ng","homepage":null,"size":1365,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86"},"html":{"href":"https://github.com/PressLabs/presswise-ng/pull/86"},"issue":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/issues/86"},"comments":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/30b968f16ad9eea4f1bfcdb3d9a2e47cbd8685b8"}}}}