{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos-metrics/pulls/comments/92316425","pull_request_review_id":12828938,"id":92316425,"diff_hunk":"@@ -26,65 +26,72 @@ import (\n \t\"github.com/dcos/dcos-metrics/producers\"\n )\n \n-var nodeColLog = log.WithFields(log.Fields{\n-\t\"collector\": \"node\",\n-})\n-\n // Collector defines the collector type for system-level metrics.\n type Collector struct {\n-\tPollPeriod time.Duration `yaml:\"poll_period,omitempty\"`\n-\n+\tPollPeriod  time.Duration `yaml:\"poll_period,omitempty\"`\n \tMetricsChan chan producers.MetricsMessage\n-\tNodeInfo    collectors.NodeInfo\n \n+\tlog         *log.Entry\n+\tnodeInfo    collectors.NodeInfo\n \tnodeMetrics nodeMetrics\n \ttimestamp   int64\n }\n \n+// New returns a new instance of the node metrics collector and a metrics chan.\n+func New(cfg Collector, nodeInfo collectors.NodeInfo) (Collector, chan producers.MetricsMessage) {\n+\tc := Collector{\n+\t\tPollPeriod:  cfg.PollPeriod,\n+\t\tMetricsChan: make(chan producers.MetricsMessage),\n+\t\tlog:         log.WithFields(log.Fields{\"collector\": \"node\"}),","path":"collectors/node/node.go","position":27,"original_position":27,"commit_id":"4c4a9eead46ae04a8e1ee207c1986ef2adb8f920","original_commit_id":"033c8df8fc68b6afb4b9ca6723a142581777baf4","user":{"login":"malnick","id":4028224,"avatar_url":"https://avatars.githubusercontent.com/u/4028224?v=3","gravatar_id":"","url":"https://api.github.com/users/malnick","html_url":"https://github.com/malnick","followers_url":"https://api.github.com/users/malnick/followers","following_url":"https://api.github.com/users/malnick/following{/other_user}","gists_url":"https://api.github.com/users/malnick/gists{/gist_id}","starred_url":"https://api.github.com/users/malnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malnick/subscriptions","organizations_url":"https://api.github.com/users/malnick/orgs","repos_url":"https://api.github.com/users/malnick/repos","events_url":"https://api.github.com/users/malnick/events{/privacy}","received_events_url":"https://api.github.com/users/malnick/received_events","type":"User","site_admin":false},"body":":+1:  I really like adding logger to the `New` instance\r\n","created_at":"2016-12-14T03:21:39Z","updated_at":"2016-12-14T03:30:11Z","html_url":"https://github.com/dcos/dcos-metrics/pull/57#discussion_r92316425","pull_request_url":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-metrics/pulls/comments/92316425"},"html":{"href":"https://github.com/dcos/dcos-metrics/pull/57#discussion_r92316425"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57","id":97870270,"html_url":"https://github.com/dcos/dcos-metrics/pull/57","diff_url":"https://github.com/dcos/dcos-metrics/pull/57.diff","patch_url":"https://github.com/dcos/dcos-metrics/pull/57.patch","issue_url":"https://api.github.com/repos/dcos/dcos-metrics/issues/57","number":57,"state":"open","locked":false,"title":"RC1 bug fixes and code cleanup","user":{"login":"rji","id":1910193,"avatar_url":"https://avatars.githubusercontent.com/u/1910193?v=3","gravatar_id":"","url":"https://api.github.com/users/rji","html_url":"https://github.com/rji","followers_url":"https://api.github.com/users/rji/followers","following_url":"https://api.github.com/users/rji/following{/other_user}","gists_url":"https://api.github.com/users/rji/gists{/gist_id}","starred_url":"https://api.github.com/users/rji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rji/subscriptions","organizations_url":"https://api.github.com/users/rji/orgs","repos_url":"https://api.github.com/users/rji/repos","events_url":"https://api.github.com/users/rji/events{/privacy}","received_events_url":"https://api.github.com/users/rji/received_events","type":"User","site_admin":false},"body":"This PR resolves issues found while testing RC1, specifically around node info being copied / set in individual collectors instead of once when the service starts up. Along with fixing that, this PR also includes a bunch of collector code cleanup to make each collector package more consistent.\r\n\r\nThere's also a new `collectors.MetricsCollector` interface, but it'll take a bit more work to get the collectors to use it. I'll save that for a future PR.","created_at":"2016-12-14T01:20:49Z","updated_at":"2016-12-14T03:30:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a528dc04602583110794225ae4416e6ede4856ff","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos-metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos-metrics/issues/57/comments","statuses_url":"https://api.github.com/repos/dcos/dcos-metrics/statuses/4c4a9eead46ae04a8e1ee207c1986ef2adb8f920","head":{"label":"dcos:rc1-bug-fixes","ref":"rc1-bug-fixes","sha":"4c4a9eead46ae04a8e1ee207c1986ef2adb8f920","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":69297151,"name":"dcos-metrics","full_name":"dcos/dcos-metrics","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-metrics","description":"Make metrics accessible.","fork":false,"url":"https://api.github.com/repos/dcos/dcos-metrics","forks_url":"https://api.github.com/repos/dcos/dcos-metrics/forks","keys_url":"https://api.github.com/repos/dcos/dcos-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-metrics/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-metrics/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-metrics/events","assignees_url":"https://api.github.com/repos/dcos/dcos-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-metrics/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-metrics/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-metrics/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-metrics/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-metrics/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-metrics/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-metrics/merges","archive_url":"https://api.github.com/repos/dcos/dcos-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-metrics/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-metrics/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-metrics/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-metrics/deployments","created_at":"2016-09-26T22:12:52Z","updated_at":"2016-10-27T08:35:30Z","pushed_at":"2016-12-14T01:31:59Z","git_url":"git://github.com/dcos/dcos-metrics.git","ssh_url":"git@github.com:dcos/dcos-metrics.git","clone_url":"https://github.com/dcos/dcos-metrics.git","svn_url":"https://github.com/dcos/dcos-metrics","homepage":"","size":2193,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":13,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"6ba1b31c4656a5bd07104c5da50cfedda8eac52b","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":69297151,"name":"dcos-metrics","full_name":"dcos/dcos-metrics","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-metrics","description":"Make metrics accessible.","fork":false,"url":"https://api.github.com/repos/dcos/dcos-metrics","forks_url":"https://api.github.com/repos/dcos/dcos-metrics/forks","keys_url":"https://api.github.com/repos/dcos/dcos-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-metrics/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-metrics/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-metrics/events","assignees_url":"https://api.github.com/repos/dcos/dcos-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-metrics/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-metrics/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-metrics/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-metrics/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-metrics/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-metrics/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-metrics/merges","archive_url":"https://api.github.com/repos/dcos/dcos-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-metrics/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-metrics/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-metrics/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-metrics/deployments","created_at":"2016-09-26T22:12:52Z","updated_at":"2016-10-27T08:35:30Z","pushed_at":"2016-12-14T01:31:59Z","git_url":"git://github.com/dcos/dcos-metrics.git","ssh_url":"git@github.com:dcos/dcos-metrics.git","clone_url":"https://github.com/dcos/dcos-metrics.git","svn_url":"https://github.com/dcos/dcos-metrics","homepage":"","size":2193,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57"},"html":{"href":"https://github.com/dcos/dcos-metrics/pull/57"},"issue":{"href":"https://api.github.com/repos/dcos/dcos-metrics/issues/57"},"comments":{"href":"https://api.github.com/repos/dcos/dcos-metrics/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos-metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos-metrics/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos-metrics/statuses/4c4a9eead46ae04a8e1ee207c1986ef2adb8f920"}}}}
{"actor":{"display_login":"malnick"}}