{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments/32312645","id":32312645,"diff_hunk":"@@ -255,7 +256,50 @@ var statMetrics = []SupportedStatMetric{\n \t\t},\n \t\tOnlyExportIfChanged: true,\n \t},\n-\n+\t{\n+\t\tMetricDescriptor: MetricDescriptor{\n+\t\t\tName:        \"cpu/node_usage\",\n+\t\t\tDescription: \"Cumulative CPU usage on all cores on a node\",\n+\t\t\tType:        MetricCumulative,\n+\t\t\tValueType:   ValueInt64,\n+\t\t\tUnits:       UnitsNanoseconds,\n+\t\t},\n+\t\tHasValue: func(spec *source_api.ContainerSpec) bool {\n+\t\t\treturn spec.HasCpu && spec.HasResourceId\n+\t\t},\n+\t\tGetValue: func(spec *source_api.ContainerSpec, stat *cadvisor.ContainerStats) []internalPoint {\n+\t\t\tresult := internalPoint{\n+\t\t\t\tvalue: int64(stat.Cpu.Usage.Total),\n+\t\t\t\tlabels: map[string]string{\n+\t\t\t\t\tLabelComputeResourceID:   spec.ResourceId,\n+\t\t\t\t\tLabelComputeResourceType: \"instance\",\n+\t\t\t\t},\n+\t\t\t}\n+\t\t\treturn []internalPoint{result}\n+\t\t},\n+\t},\n+\t{\n+\t\tMetricDescriptor: MetricDescriptor{\n+\t\t\tName:        \"memory/node_usage\",","path":"sinks/api/supported_metrics.go","position":219,"original_position":219,"commit_id":"620e8731eedfa98209bda4a7a7bcf36ebe400095","original_commit_id":"620e8731eedfa98209bda4a7a7bcf36ebe400095","user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"body":"The same as above: `memory/usage` is polluted with container stats.","created_at":"2015-06-12T12:51:13Z","updated_at":"2015-06-12T12:51:13Z","html_url":"https://github.com/GoogleCloudPlatform/heapster/pull/334#discussion_r32312645","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments/32312645"},"html":{"href":"https://github.com/GoogleCloudPlatform/heapster/pull/334#discussion_r32312645"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334","id":37453453,"html_url":"https://github.com/GoogleCloudPlatform/heapster/pull/334","diff_url":"https://github.com/GoogleCloudPlatform/heapster/pull/334.diff","patch_url":"https://github.com/GoogleCloudPlatform/heapster/pull/334.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/334","number":334,"state":"open","locked":false,"title":"Additional node metrics for autoscaling.","user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"body":"Added additional node metrics (tracking cpu and mem usage) together with additional lables. They are in format compatible with cloud autoscaler, and they can be used to autoscale the numer of nodes in a cluster.","created_at":"2015-06-11T11:26:46Z","updated_at":"2015-06-12T12:51:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1eafa7916ba79859f84d64e2c59b7af79b838667","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/334/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/statuses/620e8731eedfa98209bda4a7a7bcf36ebe400095","head":{"label":"jszczepkowski:autoscaler-metrics","ref":"autoscaler-metrics","sha":"620e8731eedfa98209bda4a7a7bcf36ebe400095","user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"repo":{"id":36804762,"name":"heapster","full_name":"jszczepkowski/heapster","owner":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jszczepkowski/heapster","description":"Monitor container resource usage of a Kubernetes cluster","fork":true,"url":"https://api.github.com/repos/jszczepkowski/heapster","forks_url":"https://api.github.com/repos/jszczepkowski/heapster/forks","keys_url":"https://api.github.com/repos/jszczepkowski/heapster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jszczepkowski/heapster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jszczepkowski/heapster/teams","hooks_url":"https://api.github.com/repos/jszczepkowski/heapster/hooks","issue_events_url":"https://api.github.com/repos/jszczepkowski/heapster/issues/events{/number}","events_url":"https://api.github.com/repos/jszczepkowski/heapster/events","assignees_url":"https://api.github.com/repos/jszczepkowski/heapster/assignees{/user}","branches_url":"https://api.github.com/repos/jszczepkowski/heapster/branches{/branch}","tags_url":"https://api.github.com/repos/jszczepkowski/heapster/tags","blobs_url":"https://api.github.com/repos/jszczepkowski/heapster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jszczepkowski/heapster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jszczepkowski/heapster/git/refs{/sha}","trees_url":"https://api.github.com/repos/jszczepkowski/heapster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jszczepkowski/heapster/statuses/{sha}","languages_url":"https://api.github.com/repos/jszczepkowski/heapster/languages","stargazers_url":"https://api.github.com/repos/jszczepkowski/heapster/stargazers","contributors_url":"https://api.github.com/repos/jszczepkowski/heapster/contributors","subscribers_url":"https://api.github.com/repos/jszczepkowski/heapster/subscribers","subscription_url":"https://api.github.com/repos/jszczepkowski/heapster/subscription","commits_url":"https://api.github.com/repos/jszczepkowski/heapster/commits{/sha}","git_commits_url":"https://api.github.com/repos/jszczepkowski/heapster/git/commits{/sha}","comments_url":"https://api.github.com/repos/jszczepkowski/heapster/comments{/number}","issue_comment_url":"https://api.github.com/repos/jszczepkowski/heapster/issues/comments{/number}","contents_url":"https://api.github.com/repos/jszczepkowski/heapster/contents/{+path}","compare_url":"https://api.github.com/repos/jszczepkowski/heapster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jszczepkowski/heapster/merges","archive_url":"https://api.github.com/repos/jszczepkowski/heapster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jszczepkowski/heapster/downloads","issues_url":"https://api.github.com/repos/jszczepkowski/heapster/issues{/number}","pulls_url":"https://api.github.com/repos/jszczepkowski/heapster/pulls{/number}","milestones_url":"https://api.github.com/repos/jszczepkowski/heapster/milestones{/number}","notifications_url":"https://api.github.com/repos/jszczepkowski/heapster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jszczepkowski/heapster/labels{/name}","releases_url":"https://api.github.com/repos/jszczepkowski/heapster/releases{/id}","created_at":"2015-06-03T13:17:40Z","updated_at":"2015-06-03T13:17:41Z","pushed_at":"2015-06-11T10:38:04Z","git_url":"git://github.com/jszczepkowski/heapster.git","ssh_url":"git@github.com:jszczepkowski/heapster.git","clone_url":"https://github.com/jszczepkowski/heapster.git","svn_url":"https://github.com/jszczepkowski/heapster","homepage":"","size":18567,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"171e6b7fb88b6d439772b46c9409c0bb3ccc3d3b","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":23272510,"name":"heapster","full_name":"GoogleCloudPlatform/heapster","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/heapster","description":"Monitor container resource usage of a Kubernetes cluster","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/heapster","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/releases{/id}","created_at":"2014-08-24T03:50:18Z","updated_at":"2015-06-12T08:44:12Z","pushed_at":"2015-06-11T22:26:04Z","git_url":"git://github.com/GoogleCloudPlatform/heapster.git","ssh_url":"git@github.com:GoogleCloudPlatform/heapster.git","clone_url":"https://github.com/GoogleCloudPlatform/heapster.git","svn_url":"https://github.com/GoogleCloudPlatform/heapster","homepage":"","size":20496,"stargazers_count":306,"watchers_count":306,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":65,"forks":72,"open_issues":65,"watchers":306,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334"},"html":{"href":"https://github.com/GoogleCloudPlatform/heapster/pull/334"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/334"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/334/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/334/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/statuses/620e8731eedfa98209bda4a7a7bcf36ebe400095"}}}}