{"action":"created","comment":{"url":"https://api.github.com/repos/pinterest/teletraan/pulls/comments/61309168","id":61309168,"diff_hunk":"@@ -517,4 +519,52 @@ PingResponseBean generateDeleteResponse(GoalAnalyst.UninstallCandidate candidate\n         response.setDeployGoal(goal);\n         return response;\n     }\n+\n+\n+    private static boolean isApplicable(Integer val) {\n+        return val != null && val > 0;\n+    }\n+\n+    /**\n+     * Get the parallel count for execution. There are two configs can have effect. The maxParallel that specifies\n+     * how many hosts and maxParallelPercentage that specifies the percentage of the Hosts. In common cases, there\n+     * should be only one of them be effective as the UI and Bean update clear the other (Set to 0) when you set one.\n+     * The rules are simple:\n+     * 1. If only one of them is set, use that.\n+     * 2. If both of them are set, use the minimum value\n+     * @param environBean\n+     * @param totalHosts\n+     * @return The maximum parallel count the system respects\n+     * @throws Exception\n+     */\n+    public final static int getFinalMaxParallelCount(EnvironBean environBean, long totalHosts) throws Exception {\n+\n+        int ret = Constants.DEFAULT_MAX_PARALLEL_HOSTS;\n+        LOG.info(\"Get final maximum parallel count for total capactiy {}\", totalHosts);","path":"deploy-service/common/src/main/java/com/pinterest/deployservice/handler/PingHandler.java","position":138,"original_position":138,"commit_id":"04ff50e0845c3fcf40323378f6adc38e62937560","original_commit_id":"04ff50e0845c3fcf40323378f6adc38e62937560","user":{"login":"sbaogang","id":6217693,"avatar_url":"https://avatars.githubusercontent.com/u/6217693?v=3","gravatar_id":"","url":"https://api.github.com/users/sbaogang","html_url":"https://github.com/sbaogang","followers_url":"https://api.github.com/users/sbaogang/followers","following_url":"https://api.github.com/users/sbaogang/following{/other_user}","gists_url":"https://api.github.com/users/sbaogang/gists{/gist_id}","starred_url":"https://api.github.com/users/sbaogang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbaogang/subscriptions","organizations_url":"https://api.github.com/users/sbaogang/orgs","repos_url":"https://api.github.com/users/sbaogang/repos","events_url":"https://api.github.com/users/sbaogang/events{/privacy}","received_events_url":"https://api.github.com/users/sbaogang/received_events","type":"User","site_admin":false},"body":"can we change info->debug?","created_at":"2016-04-27T18:16:05Z","updated_at":"2016-04-27T18:16:05Z","html_url":"https://github.com/pinterest/teletraan/pull/132#discussion_r61309168","pull_request_url":"https://api.github.com/repos/pinterest/teletraan/pulls/132","_links":{"self":{"href":"https://api.github.com/repos/pinterest/teletraan/pulls/comments/61309168"},"html":{"href":"https://github.com/pinterest/teletraan/pull/132#discussion_r61309168"},"pull_request":{"href":"https://api.github.com/repos/pinterest/teletraan/pulls/132"}}},"pull_request":{"url":"https://api.github.com/repos/pinterest/teletraan/pulls/132","id":67980213,"html_url":"https://github.com/pinterest/teletraan/pull/132","diff_url":"https://github.com/pinterest/teletraan/pull/132.diff","patch_url":"https://github.com/pinterest/teletraan/pull/132.patch","issue_url":"https://api.github.com/repos/pinterest/teletraan/issues/132","number":132,"state":"open","locked":false,"title":"Allowing set a percentage number for maximum number of hosts deployed","user":{"login":"lilida","id":2219571,"avatar_url":"https://avatars.githubusercontent.com/u/2219571?v=3","gravatar_id":"","url":"https://api.github.com/users/lilida","html_url":"https://github.com/lilida","followers_url":"https://api.github.com/users/lilida/followers","following_url":"https://api.github.com/users/lilida/following{/other_user}","gists_url":"https://api.github.com/users/lilida/gists{/gist_id}","starred_url":"https://api.github.com/users/lilida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilida/subscriptions","organizations_url":"https://api.github.com/users/lilida/orgs","repos_url":"https://api.github.com/users/lilida/repos","events_url":"https://api.github.com/users/lilida/events{/privacy}","received_events_url":"https://api.github.com/users/lilida/received_events","type":"User","site_admin":false},"body":"Allowing set a percentage number for maximum number of hosts deployed  in parallel. Originally, only a fixed number of hosts can be specified. This is not ideal for an environment with dynamically scaling. Now, we support set a percentage number. Note: The host number is still there. They are set not he same UI. When the input contains a %, it is treated a percentage. At UI and Bean level, we have tried to clear the other one when one is set.\r\n\r\nTests:\r\nUnit tests coverage for algorithm to pick the right value.\r\nTest set different values in the UI and validate the values have been used.","created_at":"2016-04-27T00:39:39Z","updated_at":"2016-04-27T18:16:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e191cc8ef230aca557017d3343c9a22d5ddd9817","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pinterest/teletraan/pulls/132/commits","review_comments_url":"https://api.github.com/repos/pinterest/teletraan/pulls/132/comments","review_comment_url":"https://api.github.com/repos/pinterest/teletraan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pinterest/teletraan/issues/132/comments","statuses_url":"https://api.github.com/repos/pinterest/teletraan/statuses/04ff50e0845c3fcf40323378f6adc38e62937560","head":{"label":"lilida:feature_percentage_host","ref":"feature_percentage_host","sha":"04ff50e0845c3fcf40323378f6adc38e62937560","user":{"login":"lilida","id":2219571,"avatar_url":"https://avatars.githubusercontent.com/u/2219571?v=3","gravatar_id":"","url":"https://api.github.com/users/lilida","html_url":"https://github.com/lilida","followers_url":"https://api.github.com/users/lilida/followers","following_url":"https://api.github.com/users/lilida/following{/other_user}","gists_url":"https://api.github.com/users/lilida/gists{/gist_id}","starred_url":"https://api.github.com/users/lilida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilida/subscriptions","organizations_url":"https://api.github.com/users/lilida/orgs","repos_url":"https://api.github.com/users/lilida/repos","events_url":"https://api.github.com/users/lilida/events{/privacy}","received_events_url":"https://api.github.com/users/lilida/received_events","type":"User","site_admin":false},"repo":{"id":53553431,"name":"teletraan","full_name":"lilida/teletraan","owner":{"login":"lilida","id":2219571,"avatar_url":"https://avatars.githubusercontent.com/u/2219571?v=3","gravatar_id":"","url":"https://api.github.com/users/lilida","html_url":"https://github.com/lilida","followers_url":"https://api.github.com/users/lilida/followers","following_url":"https://api.github.com/users/lilida/following{/other_user}","gists_url":"https://api.github.com/users/lilida/gists{/gist_id}","starred_url":"https://api.github.com/users/lilida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilida/subscriptions","organizations_url":"https://api.github.com/users/lilida/orgs","repos_url":"https://api.github.com/users/lilida/repos","events_url":"https://api.github.com/users/lilida/events{/privacy}","received_events_url":"https://api.github.com/users/lilida/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lilida/teletraan","description":"Teletraan is Pinterest's deploy system.","fork":true,"url":"https://api.github.com/repos/lilida/teletraan","forks_url":"https://api.github.com/repos/lilida/teletraan/forks","keys_url":"https://api.github.com/repos/lilida/teletraan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lilida/teletraan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lilida/teletraan/teams","hooks_url":"https://api.github.com/repos/lilida/teletraan/hooks","issue_events_url":"https://api.github.com/repos/lilida/teletraan/issues/events{/number}","events_url":"https://api.github.com/repos/lilida/teletraan/events","assignees_url":"https://api.github.com/repos/lilida/teletraan/assignees{/user}","branches_url":"https://api.github.com/repos/lilida/teletraan/branches{/branch}","tags_url":"https://api.github.com/repos/lilida/teletraan/tags","blobs_url":"https://api.github.com/repos/lilida/teletraan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lilida/teletraan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lilida/teletraan/git/refs{/sha}","trees_url":"https://api.github.com/repos/lilida/teletraan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lilida/teletraan/statuses/{sha}","languages_url":"https://api.github.com/repos/lilida/teletraan/languages","stargazers_url":"https://api.github.com/repos/lilida/teletraan/stargazers","contributors_url":"https://api.github.com/repos/lilida/teletraan/contributors","subscribers_url":"https://api.github.com/repos/lilida/teletraan/subscribers","subscription_url":"https://api.github.com/repos/lilida/teletraan/subscription","commits_url":"https://api.github.com/repos/lilida/teletraan/commits{/sha}","git_commits_url":"https://api.github.com/repos/lilida/teletraan/git/commits{/sha}","comments_url":"https://api.github.com/repos/lilida/teletraan/comments{/number}","issue_comment_url":"https://api.github.com/repos/lilida/teletraan/issues/comments{/number}","contents_url":"https://api.github.com/repos/lilida/teletraan/contents/{+path}","compare_url":"https://api.github.com/repos/lilida/teletraan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lilida/teletraan/merges","archive_url":"https://api.github.com/repos/lilida/teletraan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lilida/teletraan/downloads","issues_url":"https://api.github.com/repos/lilida/teletraan/issues{/number}","pulls_url":"https://api.github.com/repos/lilida/teletraan/pulls{/number}","milestones_url":"https://api.github.com/repos/lilida/teletraan/milestones{/number}","notifications_url":"https://api.github.com/repos/lilida/teletraan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lilida/teletraan/labels{/name}","releases_url":"https://api.github.com/repos/lilida/teletraan/releases{/id}","deployments_url":"https://api.github.com/repos/lilida/teletraan/deployments","created_at":"2016-03-10T03:53:37Z","updated_at":"2016-03-10T03:53:40Z","pushed_at":"2016-04-27T00:38:24Z","git_url":"git://github.com/lilida/teletraan.git","ssh_url":"git@github.com:lilida/teletraan.git","clone_url":"https://github.com/lilida/teletraan.git","svn_url":"https://github.com/lilida/teletraan","homepage":"","size":11745,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"pinterest:master","ref":"master","sha":"f8a55578d7074099a619693e4c9d6c81a7e69954","user":{"login":"pinterest","id":541152,"avatar_url":"https://avatars.githubusercontent.com/u/541152?v=3","gravatar_id":"","url":"https://api.github.com/users/pinterest","html_url":"https://github.com/pinterest","followers_url":"https://api.github.com/users/pinterest/followers","following_url":"https://api.github.com/users/pinterest/following{/other_user}","gists_url":"https://api.github.com/users/pinterest/gists{/gist_id}","starred_url":"https://api.github.com/users/pinterest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinterest/subscriptions","organizations_url":"https://api.github.com/users/pinterest/orgs","repos_url":"https://api.github.com/users/pinterest/repos","events_url":"https://api.github.com/users/pinterest/events{/privacy}","received_events_url":"https://api.github.com/users/pinterest/received_events","type":"Organization","site_admin":false},"repo":{"id":47722143,"name":"teletraan","full_name":"pinterest/teletraan","owner":{"login":"pinterest","id":541152,"avatar_url":"https://avatars.githubusercontent.com/u/541152?v=3","gravatar_id":"","url":"https://api.github.com/users/pinterest","html_url":"https://github.com/pinterest","followers_url":"https://api.github.com/users/pinterest/followers","following_url":"https://api.github.com/users/pinterest/following{/other_user}","gists_url":"https://api.github.com/users/pinterest/gists{/gist_id}","starred_url":"https://api.github.com/users/pinterest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinterest/subscriptions","organizations_url":"https://api.github.com/users/pinterest/orgs","repos_url":"https://api.github.com/users/pinterest/repos","events_url":"https://api.github.com/users/pinterest/events{/privacy}","received_events_url":"https://api.github.com/users/pinterest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pinterest/teletraan","description":"Teletraan is Pinterest's deploy system.","fork":false,"url":"https://api.github.com/repos/pinterest/teletraan","forks_url":"https://api.github.com/repos/pinterest/teletraan/forks","keys_url":"https://api.github.com/repos/pinterest/teletraan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pinterest/teletraan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pinterest/teletraan/teams","hooks_url":"https://api.github.com/repos/pinterest/teletraan/hooks","issue_events_url":"https://api.github.com/repos/pinterest/teletraan/issues/events{/number}","events_url":"https://api.github.com/repos/pinterest/teletraan/events","assignees_url":"https://api.github.com/repos/pinterest/teletraan/assignees{/user}","branches_url":"https://api.github.com/repos/pinterest/teletraan/branches{/branch}","tags_url":"https://api.github.com/repos/pinterest/teletraan/tags","blobs_url":"https://api.github.com/repos/pinterest/teletraan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pinterest/teletraan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pinterest/teletraan/git/refs{/sha}","trees_url":"https://api.github.com/repos/pinterest/teletraan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pinterest/teletraan/statuses/{sha}","languages_url":"https://api.github.com/repos/pinterest/teletraan/languages","stargazers_url":"https://api.github.com/repos/pinterest/teletraan/stargazers","contributors_url":"https://api.github.com/repos/pinterest/teletraan/contributors","subscribers_url":"https://api.github.com/repos/pinterest/teletraan/subscribers","subscription_url":"https://api.github.com/repos/pinterest/teletraan/subscription","commits_url":"https://api.github.com/repos/pinterest/teletraan/commits{/sha}","git_commits_url":"https://api.github.com/repos/pinterest/teletraan/git/commits{/sha}","comments_url":"https://api.github.com/repos/pinterest/teletraan/comments{/number}","issue_comment_url":"https://api.github.com/repos/pinterest/teletraan/issues/comments{/number}","contents_url":"https://api.github.com/repos/pinterest/teletraan/contents/{+path}","compare_url":"https://api.github.com/repos/pinterest/teletraan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pinterest/teletraan/merges","archive_url":"https://api.github.com/repos/pinterest/teletraan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pinterest/teletraan/downloads","issues_url":"https://api.github.com/repos/pinterest/teletraan/issues{/number}","pulls_url":"https://api.github.com/repos/pinterest/teletraan/pulls{/number}","milestones_url":"https://api.github.com/repos/pinterest/teletraan/milestones{/number}","notifications_url":"https://api.github.com/repos/pinterest/teletraan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pinterest/teletraan/labels{/name}","releases_url":"https://api.github.com/repos/pinterest/teletraan/releases{/id}","deployments_url":"https://api.github.com/repos/pinterest/teletraan/deployments","created_at":"2015-12-09T22:08:45Z","updated_at":"2016-04-27T11:49:22Z","pushed_at":"2016-04-27T00:39:40Z","git_url":"git://github.com/pinterest/teletraan.git","ssh_url":"git@github.com:pinterest/teletraan.git","clone_url":"https://github.com/pinterest/teletraan.git","svn_url":"https://github.com/pinterest/teletraan","homepage":"","size":11834,"stargazers_count":1622,"watchers_count":1622,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"open_issues_count":8,"forks":103,"open_issues":8,"watchers":1622,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pinterest/teletraan/pulls/132"},"html":{"href":"https://github.com/pinterest/teletraan/pull/132"},"issue":{"href":"https://api.github.com/repos/pinterest/teletraan/issues/132"},"comments":{"href":"https://api.github.com/repos/pinterest/teletraan/issues/132/comments"},"review_comments":{"href":"https://api.github.com/repos/pinterest/teletraan/pulls/132/comments"},"review_comment":{"href":"https://api.github.com/repos/pinterest/teletraan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pinterest/teletraan/pulls/132/commits"},"statuses":{"href":"https://api.github.com/repos/pinterest/teletraan/statuses/04ff50e0845c3fcf40323378f6adc38e62937560"}}}}