{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/52612063","id":52612063,"diff_hunk":"@@ -134,37 +140,94 @@ func parseTestOutput(scanner *bufio.Scanner, buildNumber int, resources sets.Str\n \treturn hist\n }\n \n-func getLatencyData(client *jenkins.JenkinsClient, job string) (TestToBuildData, sets.String, sets.String, error) {\n+// returns build number of the next run greater than *startFrom\n+// TODO: if anyone has any idea how to do it better, please do\n+func binSearch() int {\n+\tstart := *startFrom\n+\tend := *startFrom + 1\n+\t// search from some build number without result\n+\tresponse, err := http.Get(fmt.Sprintf(\"%v%v%v\", urlPrefix, start, urlSuffix))\n+\tif err != nil {\n+\t\tpanic(err)\n+\t}\n+\tif response.StatusCode != 200 {\n+\t\treturn start\n+\t}\n+\tresponse, err = http.Get(fmt.Sprintf(\"%v%v%v\", urlPrefix, end, urlSuffix))\n+\tif err != nil {\n+\t\tpanic(err)\n+\t}\n+\tif response.StatusCode != 200 {\n+\t\treturn end\n+\t}\n+\tinc := 1\n+\tfor response.StatusCode == 200 {\n+\t\tinc *= 2\n+\t\tstart = end\n+\t\tend += inc\n+\t\tresponse, err = http.Get(fmt.Sprintf(\"%v%v%v\", urlPrefix, end, urlSuffix))\n+\t\tif err != nil {\n+\t\t\tpanic(err)\n+\t\t}\n+\t}\n+\t// We know that data exists for start and does not exist for end. Now binary search.\n+\tfor start+1 < end {","path":"perfdash/perfdash.go","position":64,"original_position":64,"commit_id":"b3ac93ec8a3ab9c881578740a4e50eca2751cb2e","original_commit_id":"b3ac93ec8a3ab9c881578740a4e50eca2751cb2e","user":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"body":"I think it would be simpler to do:\r\n\r\nfor start < end {\r\n  candidate = (start + end) / 2\r\n  if response == 200 {\r\n    start = candidate+1\r\n  } else {\r\n    end = candidate \r\n  }\r\n}\r\n\r\nThen you are guaranteed to have start=end at the end, and don't need the rest of the code.","created_at":"2016-02-11T15:02:10Z","updated_at":"2016-02-11T15:02:10Z","html_url":"https://github.com/kubernetes/contrib/pull/482#discussion_r52612063","pull_request_url":"https://api.github.com/repos/kubernetes/contrib/pulls/482","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/52612063"},"html":{"href":"https://github.com/kubernetes/contrib/pull/482#discussion_r52612063"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/482"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/482","id":59039701,"html_url":"https://github.com/kubernetes/contrib/pull/482","diff_url":"https://github.com/kubernetes/contrib/pull/482.diff","patch_url":"https://github.com/kubernetes/contrib/pull/482.patch","issue_url":"https://api.github.com/repos/kubernetes/contrib/issues/482","number":482,"state":"open","locked":false,"title":"Perfdash uses GCS as a source","user":{"login":"gmarek","id":1703842,"avatar_url":"https://avatars.githubusercontent.com/u/1703842?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarek","html_url":"https://github.com/gmarek","followers_url":"https://api.github.com/users/gmarek/followers","following_url":"https://api.github.com/users/gmarek/following{/other_user}","gists_url":"https://api.github.com/users/gmarek/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarek/subscriptions","organizations_url":"https://api.github.com/users/gmarek/orgs","repos_url":"https://api.github.com/users/gmarek/repos","events_url":"https://api.github.com/users/gmarek/events{/privacy}","received_events_url":"https://api.github.com/users/gmarek/received_events","type":"User","site_admin":false},"body":"@spiffxp @jeremyeder ","created_at":"2016-02-11T14:43:27Z","updated_at":"2016-02-11T15:02:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"835c4b7713bbcbd61546a59cd7402a23415d5a6a","assignee":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/contrib/pulls/482/commits","review_comments_url":"https://api.github.com/repos/kubernetes/contrib/pulls/482/comments","review_comment_url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/482/comments","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/b3ac93ec8a3ab9c881578740a4e50eca2751cb2e","head":{"label":"gmarek:compare","ref":"compare","sha":"b3ac93ec8a3ab9c881578740a4e50eca2751cb2e","user":{"login":"gmarek","id":1703842,"avatar_url":"https://avatars.githubusercontent.com/u/1703842?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarek","html_url":"https://github.com/gmarek","followers_url":"https://api.github.com/users/gmarek/followers","following_url":"https://api.github.com/users/gmarek/following{/other_user}","gists_url":"https://api.github.com/users/gmarek/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarek/subscriptions","organizations_url":"https://api.github.com/users/gmarek/orgs","repos_url":"https://api.github.com/users/gmarek/repos","events_url":"https://api.github.com/users/gmarek/events{/privacy}","received_events_url":"https://api.github.com/users/gmarek/received_events","type":"User","site_admin":false},"repo":{"id":46272843,"name":"contrib","full_name":"gmarek/contrib","owner":{"login":"gmarek","id":1703842,"avatar_url":"https://avatars.githubusercontent.com/u/1703842?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarek","html_url":"https://github.com/gmarek","followers_url":"https://api.github.com/users/gmarek/followers","following_url":"https://api.github.com/users/gmarek/following{/other_user}","gists_url":"https://api.github.com/users/gmarek/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarek/subscriptions","organizations_url":"https://api.github.com/users/gmarek/orgs","repos_url":"https://api.github.com/users/gmarek/repos","events_url":"https://api.github.com/users/gmarek/events{/privacy}","received_events_url":"https://api.github.com/users/gmarek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmarek/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.","fork":true,"url":"https://api.github.com/repos/gmarek/contrib","forks_url":"https://api.github.com/repos/gmarek/contrib/forks","keys_url":"https://api.github.com/repos/gmarek/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmarek/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmarek/contrib/teams","hooks_url":"https://api.github.com/repos/gmarek/contrib/hooks","issue_events_url":"https://api.github.com/repos/gmarek/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/gmarek/contrib/events","assignees_url":"https://api.github.com/repos/gmarek/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/gmarek/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/gmarek/contrib/tags","blobs_url":"https://api.github.com/repos/gmarek/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmarek/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmarek/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmarek/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmarek/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/gmarek/contrib/languages","stargazers_url":"https://api.github.com/repos/gmarek/contrib/stargazers","contributors_url":"https://api.github.com/repos/gmarek/contrib/contributors","subscribers_url":"https://api.github.com/repos/gmarek/contrib/subscribers","subscription_url":"https://api.github.com/repos/gmarek/contrib/subscription","commits_url":"https://api.github.com/repos/gmarek/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmarek/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmarek/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmarek/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmarek/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/gmarek/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmarek/contrib/merges","archive_url":"https://api.github.com/repos/gmarek/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmarek/contrib/downloads","issues_url":"https://api.github.com/repos/gmarek/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/gmarek/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/gmarek/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/gmarek/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmarek/contrib/labels{/name}","releases_url":"https://api.github.com/repos/gmarek/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/gmarek/contrib/deployments","created_at":"2015-11-16T12:19:11Z","updated_at":"2015-11-16T12:19:12Z","pushed_at":"2016-02-11T14:41:48Z","git_url":"git://github.com/gmarek/contrib.git","ssh_url":"git@github.com:gmarek/contrib.git","clone_url":"https://github.com/gmarek/contrib.git","svn_url":"https://github.com/gmarek/contrib","homepage":"","size":16339,"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":"kubernetes:master","ref":"master","sha":"a7426871886c65220ff588ad6bcb4c0fc8903c2a","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":40686014,"name":"contrib","full_name":"kubernetes/contrib","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/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.","fork":false,"url":"https://api.github.com/repos/kubernetes/contrib","forks_url":"https://api.github.com/repos/kubernetes/contrib/forks","keys_url":"https://api.github.com/repos/kubernetes/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/contrib/teams","hooks_url":"https://api.github.com/repos/kubernetes/contrib/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/contrib/events","assignees_url":"https://api.github.com/repos/kubernetes/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/contrib/tags","blobs_url":"https://api.github.com/repos/kubernetes/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/contrib/languages","stargazers_url":"https://api.github.com/repos/kubernetes/contrib/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/contrib/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/contrib/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/contrib/subscription","commits_url":"https://api.github.com/repos/kubernetes/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/contrib/merges","archive_url":"https://api.github.com/repos/kubernetes/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/contrib/downloads","issues_url":"https://api.github.com/repos/kubernetes/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/contrib/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/contrib/deployments","created_at":"2015-08-13T23:18:26Z","updated_at":"2016-02-10T12:48:07Z","pushed_at":"2016-02-11T14:43:27Z","git_url":"git://github.com/kubernetes/contrib.git","ssh_url":"git@github.com:kubernetes/contrib.git","clone_url":"https://github.com/kubernetes/contrib.git","svn_url":"https://github.com/kubernetes/contrib","homepage":"","size":27519,"stargazers_count":152,"watchers_count":152,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":142,"mirror_url":null,"open_issues_count":103,"forks":142,"open_issues":103,"watchers":152,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/482"},"html":{"href":"https://github.com/kubernetes/contrib/pull/482"},"issue":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/482"},"comments":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/482/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/482/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/482/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/contrib/statuses/b3ac93ec8a3ab9c881578740a4e50eca2751cb2e"}}}}