{"action":"created","comment":{"url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments/203467497","pull_request_review_id":138362788,"id":203467497,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzQ2NzQ5Nw==","diff_hunk":"@@ -0,0 +1,120 @@\n+package loadbalancingbenchmark\n+\n+import (\n+\t\"fmt\"\n+\t\"time\"\n+)\n+\n+type ClientGroup struct {\n+\tCnt    int\n+\tRps    int\n+\tLType  ListType\n+\tLUType ListUpdaterType\n+}\n+\n+type LatencyConfig struct {\n+\tP50  time.Duration\n+\tP90  time.Duration\n+\tP99  time.Duration\n+\tP100 time.Duration\n+}\n+\n+type ServerGroup struct {\n+\tCnt           int\n+\tType          MachineType\n+\tLatencyConfig *LatencyConfig\n+}\n+\n+type TestConfig struct {\n+\tClientGroup []ClientGroup\n+\tServerGroup []ServerGroup\n+\tDuration    time.Duration\n+}\n+\n+// return a normal latency config that satisfy the given rps\n+func RpsLatency(rps int) *LatencyConfig {\n+\t// measure in millisecond\n+\tnormal := time.Second / time.Duration(rps)\n+\treturn &LatencyConfig{\n+\t\tP50:  time.Duration(int(0.4 * float32(normal))),\n+\t\tP90:  time.Duration(int(0.7 * float32(normal))),\n+\t\tP99:  time.Duration(int(0.8 * float32(normal))),\n+\t\tP100: time.Duration(int(2.0 * float32(normal))),\n+\t}\n+}\n+\n+func (config *TestConfig) GetClientTotalCount() int {\n+\ttotal := 0\n+\tfor _, group := range config.ClientGroup {\n+\t\ttotal += group.Cnt\n+\t}\n+\treturn total\n+}\n+\n+func (config *TestConfig) GetServerTotalCount() int {\n+\ttotal := 0\n+\tfor _, group := range config.ServerGroup {\n+\t\ttotal += group.Cnt\n+\t}\n+\treturn total\n+}\n+\n+func (clientGroup ClientGroup) checkListType() error {\n+\tlistType := clientGroup.LType\n+\tif _, ok := SupportedListType[listType]; !ok {\n+\t\treturn fmt.Errorf(`list type %q is not supported`, listType)\n+\t}\n+\treturn nil\n+}\n+\n+func (clientGroup ClientGroup) checkListUpdaterType() error {\n+\tlistUpdaterType := clientGroup.LUType\n+\tif _, ok := SupportedListUpdaterType[listUpdaterType]; !ok {\n+\t\treturn fmt.Errorf(`list updater type %q is not supported`, listUpdaterType)\n+\t}\n+\treturn nil\n+}\n+\n+func (config *TestConfig) checkClientGroup() error {\n+\tclientGroup := config.ClientGroup\n+\tfor _, group := range clientGroup {\n+\t\tif err := group.checkListType(); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tif err := group.checkListUpdaterType(); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tif group.Rps < 0 {\n+\t\t\treturn fmt.Errorf(\"rps field should be greater than 0 rps: %d\", group.Rps)","path":"internal/loadbalancebenchmark/config.go","position":88,"original_position":88,"commit_id":"599a54360398cbc11080a1cf0ff4557a9803d40f","original_commit_id":"599a54360398cbc11080a1cf0ff4557a9803d40f","user":{"login":"sxzh93","id":26440156,"node_id":"MDQ6VXNlcjI2NDQwMTU2","avatar_url":"https://avatars1.githubusercontent.com/u/26440156?v=4","gravatar_id":"","url":"https://api.github.com/users/sxzh93","html_url":"https://github.com/sxzh93","followers_url":"https://api.github.com/users/sxzh93/followers","following_url":"https://api.github.com/users/sxzh93/following{/other_user}","gists_url":"https://api.github.com/users/sxzh93/gists{/gist_id}","starred_url":"https://api.github.com/users/sxzh93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sxzh93/subscriptions","organizations_url":"https://api.github.com/users/sxzh93/orgs","repos_url":"https://api.github.com/users/sxzh93/repos","events_url":"https://api.github.com/users/sxzh93/events{/privacy}","received_events_url":"https://api.github.com/users/sxzh93/received_events","type":"User","site_admin":false},"body":"resolved.","created_at":"2018-07-18T17:37:08Z","updated_at":"2018-07-18T17:37:08Z","html_url":"https://github.com/yarpc/yarpc-go/pull/1526#discussion_r203467497","pull_request_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments/203467497"},"html":{"href":"https://github.com/yarpc/yarpc-go/pull/1526#discussion_r203467497"},"pull_request":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526"}},"in_reply_to_id":202877161},"pull_request":{"url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526","id":201794790,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNzk0Nzkw","html_url":"https://github.com/yarpc/yarpc-go/pull/1526","diff_url":"https://github.com/yarpc/yarpc-go/pull/1526.diff","patch_url":"https://github.com/yarpc/yarpc-go/pull/1526.patch","issue_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/1526","number":1526,"state":"open","locked":false,"title":"[WIP] Create benchmark for YARPC load balancing and subsetting","user":{"login":"sxzh93","id":26440156,"node_id":"MDQ6VXNlcjI2NDQwMTU2","avatar_url":"https://avatars1.githubusercontent.com/u/26440156?v=4","gravatar_id":"","url":"https://api.github.com/users/sxzh93","html_url":"https://github.com/sxzh93","followers_url":"https://api.github.com/users/sxzh93/followers","following_url":"https://api.github.com/users/sxzh93/following{/other_user}","gists_url":"https://api.github.com/users/sxzh93/gists{/gist_id}","starred_url":"https://api.github.com/users/sxzh93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sxzh93/subscriptions","organizations_url":"https://api.github.com/users/sxzh93/orgs","repos_url":"https://api.github.com/users/sxzh93/repos","events_url":"https://api.github.com/users/sxzh93/events{/privacy}","received_events_url":"https://api.github.com/users/sxzh93/received_events","type":"User","site_admin":false},"body":"Still working on unit tests, style, comments, better configuration for server type, better constant RPS implementation at Client side.","created_at":"2018-07-17T00:29:36Z","updated_at":"2018-07-18T17:37:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2dfa404e25fc2ce4ffd904a1ab618d5e88ed5db","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526/commits","review_comments_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526/comments","review_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/1526/comments","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/599a54360398cbc11080a1cf0ff4557a9803d40f","head":{"label":"yarpc:lb_benchmark","ref":"lb_benchmark","sha":"599a54360398cbc11080a1cf0ff4557a9803d40f","user":{"login":"yarpc","id":16569504,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTY5NTA0","avatar_url":"https://avatars2.githubusercontent.com/u/16569504?v=4","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390111,"node_id":"MDEwOlJlcG9zaXRvcnk1MDM5MDExMQ==","name":"yarpc-go","full_name":"yarpc/yarpc-go","owner":{"login":"yarpc","id":16569504,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTY5NTA0","avatar_url":"https://avatars2.githubusercontent.com/u/16569504?v=4","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarpc/yarpc-go","description":"A message passing platform for Go","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-go","forks_url":"https://api.github.com/repos/yarpc/yarpc-go/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-go/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-go/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-go/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-go/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-go/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-go/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-go/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-go/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-go/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-go/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-go/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-go/deployments","created_at":"2016-01-26T00:04:14Z","updated_at":"2018-07-18T04:09:41Z","pushed_at":"2018-07-18T15:03:45Z","git_url":"git://github.com/yarpc/yarpc-go.git","ssh_url":"git@github.com:yarpc/yarpc-go.git","clone_url":"https://github.com/yarpc/yarpc-go.git","svn_url":"https://github.com/yarpc/yarpc-go","homepage":"","size":10812,"stargazers_count":149,"watchers_count":149,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":31,"open_issues":10,"watchers":149,"default_branch":"dev"}},"base":{"label":"yarpc:dev","ref":"dev","sha":"ce94bab6cb0312e65dbc4bccf0a25be057caa47e","user":{"login":"yarpc","id":16569504,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTY5NTA0","avatar_url":"https://avatars2.githubusercontent.com/u/16569504?v=4","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390111,"node_id":"MDEwOlJlcG9zaXRvcnk1MDM5MDExMQ==","name":"yarpc-go","full_name":"yarpc/yarpc-go","owner":{"login":"yarpc","id":16569504,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTY5NTA0","avatar_url":"https://avatars2.githubusercontent.com/u/16569504?v=4","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarpc/yarpc-go","description":"A message passing platform for Go","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-go","forks_url":"https://api.github.com/repos/yarpc/yarpc-go/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-go/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-go/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-go/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-go/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-go/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-go/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-go/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-go/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-go/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-go/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-go/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-go/deployments","created_at":"2016-01-26T00:04:14Z","updated_at":"2018-07-18T04:09:41Z","pushed_at":"2018-07-18T15:03:45Z","git_url":"git://github.com/yarpc/yarpc-go.git","ssh_url":"git@github.com:yarpc/yarpc-go.git","clone_url":"https://github.com/yarpc/yarpc-go.git","svn_url":"https://github.com/yarpc/yarpc-go","homepage":"","size":10812,"stargazers_count":149,"watchers_count":149,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":31,"open_issues":10,"watchers":149,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526"},"html":{"href":"https://github.com/yarpc/yarpc-go/pull/1526"},"issue":{"href":"https://api.github.com/repos/yarpc/yarpc-go/issues/1526"},"comments":{"href":"https://api.github.com/repos/yarpc/yarpc-go/issues/1526/comments"},"review_comments":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526/comments"},"review_comment":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1526/commits"},"statuses":{"href":"https://api.github.com/repos/yarpc/yarpc-go/statuses/599a54360398cbc11080a1cf0ff4557a9803d40f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sxzh93"}}