{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/47237273","id":47237273,"diff_hunk":"@@ -116,3 +140,54 @@ func (handler ResourceConsumerHandler) handleGetCurrentStatus(w http.ResponseWri\n \tfmt.Fprintln(w, \"Warning: not implemented!\")\n \tfmt.Fprint(w, getCurrentStatusAddress[1:])\n }\n+\n+func (handler ResourceConsumerHandler) handleMetrics(w http.ResponseWriter) {\n+\thandler.metricsLock.Lock()\n+\tfor k, v := range handler.metrics {\n+\t\tfmt.Fprintf(w, \"# HELP %s info message.\\n\", k)\n+\t\tfmt.Fprintf(w, \"# TYPE %s gauge\\n\", k)\n+\t\tfmt.Fprintf(w, \"%s %f\\n\", k, v)\n+\t}\n+\thandler.metricsLock.Unlock()","path":"test/images/resource-consumer/resource_consumer_handler.go","position":135,"original_position":135,"commit_id":"4f7cf8571989957bf9287368296071ef6c8b6797","original_commit_id":"4f7cf8571989957bf9287368296071ef6c8b6797","user":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"body":"Move this to defer right after the line where the lock is acquired .","created_at":"2015-12-10T15:13:06Z","updated_at":"2015-12-10T15:13:06Z","html_url":"https://github.com/kubernetes/kubernetes/pull/18511#discussion_r47237273","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/47237273"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/18511#discussion_r47237273"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511","id":53267662,"html_url":"https://github.com/kubernetes/kubernetes/pull/18511","diff_url":"https://github.com/kubernetes/kubernetes/pull/18511.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/18511.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18511","number":18511,"state":"open","locked":false,"title":"Added handling custom metrics to resource consumer.","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 handling custom metrics in Prometheus format to resource consumer.","created_at":"2015-12-10T14:50:23Z","updated_at":"2015-12-10T15:13:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cc11e9050dded0c0dbd3be2e75788d1860b9914","assignee":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18511/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/4f7cf8571989957bf9287368296071ef6c8b6797","head":{"label":"jszczepkowski:cm-consumer","ref":"cm-consumer","sha":"4f7cf8571989957bf9287368296071ef6c8b6797","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":30266090,"name":"kubernetes","full_name":"jszczepkowski/kubernetes","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/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/jszczepkowski/kubernetes","forks_url":"https://api.github.com/repos/jszczepkowski/kubernetes/forks","keys_url":"https://api.github.com/repos/jszczepkowski/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jszczepkowski/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jszczepkowski/kubernetes/teams","hooks_url":"https://api.github.com/repos/jszczepkowski/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jszczepkowski/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jszczepkowski/kubernetes/events","assignees_url":"https://api.github.com/repos/jszczepkowski/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jszczepkowski/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jszczepkowski/kubernetes/tags","blobs_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jszczepkowski/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jszczepkowski/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jszczepkowski/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jszczepkowski/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jszczepkowski/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jszczepkowski/kubernetes/subscription","commits_url":"https://api.github.com/repos/jszczepkowski/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jszczepkowski/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jszczepkowski/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/jszczepkowski/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jszczepkowski/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jszczepkowski/kubernetes/merges","archive_url":"https://api.github.com/repos/jszczepkowski/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jszczepkowski/kubernetes/downloads","issues_url":"https://api.github.com/repos/jszczepkowski/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jszczepkowski/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jszczepkowski/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jszczepkowski/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jszczepkowski/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jszczepkowski/kubernetes/releases{/id}","created_at":"2015-02-03T21:42:51Z","updated_at":"2015-02-12T20:51:30Z","pushed_at":"2015-12-10T14:55:21Z","git_url":"git://github.com/jszczepkowski/kubernetes.git","ssh_url":"git@github.com:jszczepkowski/kubernetes.git","clone_url":"https://github.com/jszczepkowski/kubernetes.git","svn_url":"https://github.com/jszczepkowski/kubernetes","homepage":"http://kubernetes.io","size":137708,"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":"2ef2544faa0cf90292bcd14894c1a396322b926e","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-12-10T12:53:35Z","pushed_at":"2015-12-10T15:10:07Z","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":290588,"stargazers_count":11711,"watchers_count":11711,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3175,"mirror_url":null,"open_issues_count":2549,"forks":3175,"open_issues":2549,"watchers":11711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/18511"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/18511"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/18511/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18511/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/4f7cf8571989957bf9287368296071ef6c8b6797"}}}}