{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/37757732","id":37757732,"diff_hunk":"@@ -18,23 +18,36 @@ package autoscalercontroller\n \n import (\n \t\"fmt\"\n+\t\"strings\"\n \t\"time\"\n \n \t\"github.com/golang/glog\"\n \t\"k8s.io/kubernetes/pkg/api\"\n-\t\"k8s.io/kubernetes/pkg/client/unversioned\"\n+\tclient \"k8s.io/kubernetes/pkg/client/unversioned\"\n \t\"k8s.io/kubernetes/pkg/fields\"\n \t\"k8s.io/kubernetes/pkg/labels\"\n \t\"k8s.io/kubernetes/pkg/util\"\n )\n \n+const (\n+\theapsterNamespace = \"kube-system\"\n+\theapsterService   = \"monitoring-heapster\"\n+)\n+\n+var resourceToMetric = map[api.ResourceName]string{\n+\tapi.ResourceCPU: \"cpu-usage\",\n+}\n+var heapsterQueryStart, _ = time.ParseDuration(\"-20m\")\n+\n type HorizontalPodAutoscalerController struct {\n-\tkubeClient unversioned.ExperimentalInterface\n+\tclient    *client.Client","path":"pkg/controller/autoscaler/horizontalpodautoscaler_controller.go","position":28,"original_position":28,"commit_id":"2c02dd655c97330cbfb49279bcbbff90e24a6c73","original_commit_id":"c42efe9927ee798d6ef957fd0cc54ef3d2bb8cc9","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":"OK. Just add a TODO, we will clean it up in a subsequent PR.","created_at":"2015-08-24T14:37:52Z","updated_at":"2015-08-24T14:37:52Z","html_url":"https://github.com/kubernetes/kubernetes/pull/13081#discussion_r37757732","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/37757732"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13081#discussion_r37757732"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081","id":43150809,"html_url":"https://github.com/kubernetes/kubernetes/pull/13081","diff_url":"https://github.com/kubernetes/kubernetes/pull/13081.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/13081.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13081","number":13081,"state":"open","locked":false,"title":"Scale subresource and Heapster querying in HorizontalPodAutoscaler","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-24T08:30:59Z","updated_at":"2015-08-24T14:37:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a07be9d7a0dd4b9b9d452af7fddd9e0b41edbe28","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13081/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2c02dd655c97330cbfb49279bcbbff90e24a6c73","head":{"label":"mwielgus:hpa_heapster_query","ref":"hpa_heapster_query","sha":"2c02dd655c97330cbfb49279bcbbff90e24a6c73","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"repo":{"id":34387979,"name":"kubernetes","full_name":"mwielgus/kubernetes","owner":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwielgus/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/mwielgus/kubernetes","forks_url":"https://api.github.com/repos/mwielgus/kubernetes/forks","keys_url":"https://api.github.com/repos/mwielgus/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwielgus/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwielgus/kubernetes/teams","hooks_url":"https://api.github.com/repos/mwielgus/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mwielgus/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mwielgus/kubernetes/events","assignees_url":"https://api.github.com/repos/mwielgus/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mwielgus/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mwielgus/kubernetes/tags","blobs_url":"https://api.github.com/repos/mwielgus/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwielgus/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwielgus/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwielgus/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwielgus/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mwielgus/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mwielgus/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mwielgus/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mwielgus/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mwielgus/kubernetes/subscription","commits_url":"https://api.github.com/repos/mwielgus/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwielgus/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwielgus/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwielgus/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwielgus/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mwielgus/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwielgus/kubernetes/merges","archive_url":"https://api.github.com/repos/mwielgus/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwielgus/kubernetes/downloads","issues_url":"https://api.github.com/repos/mwielgus/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mwielgus/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mwielgus/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mwielgus/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwielgus/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mwielgus/kubernetes/releases{/id}","created_at":"2015-04-22T12:04:42Z","updated_at":"2015-04-22T12:04:46Z","pushed_at":"2015-08-24T14:37:02Z","git_url":"git://github.com/mwielgus/kubernetes.git","ssh_url":"git@github.com:mwielgus/kubernetes.git","clone_url":"https://github.com/mwielgus/kubernetes.git","svn_url":"https://github.com/mwielgus/kubernetes","homepage":"http://kubernetes.io","size":101698,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"9ad982ef772c658af4c1b264b79f5462f85d4041","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-08-24T13:30:19Z","pushed_at":"2015-08-24T14:37:04Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":358725,"stargazers_count":9867,"watchers_count":9867,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2382,"mirror_url":null,"open_issues_count":1782,"forks":2382,"open_issues":1782,"watchers":9867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13081"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13081"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13081/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13081/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2c02dd655c97330cbfb49279bcbbff90e24a6c73"}}}}