GitHub PullRequestReviewCommentEvent at 2014-07-07 02:36:48
Repository: dd-agent
Actor: wernerandrew
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/14579969","id":14579969,"diff_hunk":"@@ -96,6 +96,80 @@ def flush(self, timestamp, interval):\n \n         return []\n \n+\n+class Count(Metric):\n+    \"\"\" A metric that tracks a count. \"\"\"\n+\n+    def __init__(self, formatter, name, tags, hostname, device_name):\n+        self.formatter = formatter\n+        self.name = name\n+        self.value = 0\n+        self.tags = tags\n+        self.hostname = hostname\n+        self.device_name = device_name\n+        self.last_sample_time = None\n+\n+    def sample(self, value, sample_rate, timestamp=None):\n+        self.value += value","path":"aggregator.py","position":18,"original_position":18,"commit_id":"7299439ee3d3f9c9539f14500edc4734acfeb993","original_commit_id":"7299439ee3d3f9c9539f14500edc4734acfeb993","user":{"login":"wernerandrew","id":3391083,"avatar_url":"https://avatars.githubusercontent.com/u/3391083?","gravatar_id":"174982a2e7b2034a5fa54eaf8b4e5ddd","url":"https://api.github.com/users/wernerandrew","html_url":"https://github.com/wernerandrew","followers_url":"https://api.github.com/users/wernerandrew/followers","following_url":"https://api.github.com/users/wernerandrew/following{/other_user}","gists_url":"https://api.github.com/users/wernerandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/wernerandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wernerandrew/subscriptions","organizations_url":"https://api.github.com/users/wernerandrew/orgs","repos_url":"https://api.github.com/users/wernerandrew/repos","events_url":"https://api.github.com/users/wernerandrew/events{/privacy}","received_events_url":"https://api.github.com/users/wernerandrew/received_events","type":"User","site_admin":false},"body":"As discussed in my comment below, this should probably default to None, which will require another one liner check, e.g.:\r\n\r\n```python\r\nlast_value = self.value or 0\r\nself.value = last_value + value\r\n```","created_at":"2014-07-07T02:36:48Z","updated_at":"2014-07-07T02:36:48Z","html_url":"https://github.com/DataDog/dd-agent/pull/1012#discussion_r14579969","pull_request_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/14579969"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/1012#discussion_r14579969"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012","id":17839831,"html_url":"https://github.com/DataDog/dd-agent/pull/1012","diff_url":"https://github.com/DataDog/dd-agent/pull/1012.diff","patch_url":"https://github.com/DataDog/dd-agent/pull/1012.patch","issue_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1012","number":1012,"state":"open","title":"Add count type to Agent check","user":{"login":"isaacdd","id":7524964,"avatar_url":"https://avatars.githubusercontent.com/u/7524964?","gravatar_id":"6e58dca7021f23c7a0b4396123de3671","url":"https://api.github.com/users/isaacdd","html_url":"https://github.com/isaacdd","followers_url":"https://api.github.com/users/isaacdd/followers","following_url":"https://api.github.com/users/isaacdd/following{/other_user}","gists_url":"https://api.github.com/users/isaacdd/gists{/gist_id}","starred_url":"https://api.github.com/users/isaacdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isaacdd/subscriptions","organizations_url":"https://api.github.com/users/isaacdd/orgs","repos_url":"https://api.github.com/users/isaacdd/repos","events_url":"https://api.github.com/users/isaacdd/events{/privacy}","received_events_url":"https://api.github.com/users/isaacdd/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-07-01T16:11:51Z","updated_at":"2014-07-07T02:36:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38633399c83435fa3dad0e704af7b65e58ce91da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012/comments","review_comment_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/{number}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1012/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/7299439ee3d3f9c9539f14500edc4734acfeb993","head":{"label":"DataDog:isaac/add_count_to_agent_check","ref":"isaac/add_count_to_agent_check","sha":"7299439ee3d3f9c9539f14500edc4734acfeb993","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?","gravatar_id":"812de840123feefac39f85428fd7744a","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?","gravatar_id":"812de840123feefac39f85428fd7744a","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments/{number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2014-07-03T05:40:52Z","pushed_at":"2014-07-06T03:04:22Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":41610,"stargazers_count":196,"watchers_count":196,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"forks_count":100,"mirror_url":null,"open_issues_count":190,"forks":100,"open_issues":190,"watchers":196,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"c63ba537a570ad6662475d2bf8449722572baec0","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?","gravatar_id":"812de840123feefac39f85428fd7744a","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?","gravatar_id":"812de840123feefac39f85428fd7744a","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments/{number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2014-07-03T05:40:52Z","pushed_at":"2014-07-06T03:04:22Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":41610,"stargazers_count":196,"watchers_count":196,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"forks_count":100,"mirror_url":null,"open_issues_count":190,"forks":100,"open_issues":190,"watchers":196,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/1012"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/1012"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/1012/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1012/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-agent/statuses/7299439ee3d3f9c9539f14500edc4734acfeb993"}}}}