{"action":"created","comment":{"url":"https://api.github.com/repos/istio/istio/pulls/comments/221218662","pull_request_review_id":159815442,"id":221218662,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTIxODY2Mg==","diff_hunk":"@@ -55,12 +57,31 @@ func report(rootArgs *rootArgs, printf, fatalf shared.FormatFn) {\n \n \tspan, ctx := ot.StartSpanFromContext(context.Background(), \"mixc Report\", ext.SpanKindRPCClient)\n \n-\tfor i := 0; i < rootArgs.repeat; i++ {\n-\t\trequest := mixerpb.ReportRequest{Attributes: []mixerpb.CompressedAttributes{*attrs}}\n-\t\t_, err := cs.client.Report(ctx, &request)\n-\n-\t\tprintf(\"Report RPC returned %s\", decodeError(err))\n+\tvar rl *rate.Limiter\n+\tif rootArgs.rate > 0 {\n+\t\trl = rate.NewLimiter(rate.Limit(rootArgs.rate), rootArgs.rate)\n+\t}\n+\tif rootArgs.concurrency < 1 {\n+\t\tfatalf(\"concurrency has to be at least 1\")\n \t}\n+\tvar wg sync.WaitGroup\n+\twg.Add(rootArgs.concurrency)\n+\tfor c := 0; c < rootArgs.concurrency; c++ {\n+\t\tgo func() {\n+\t\t\tdefer wg.Done()\n+\t\t\tfor i := 0; i < rootArgs.repeat; i++ {","path":"mixer/cmd/mixc/cmd/report.go","position":34,"original_position":34,"commit_id":"606c4cca4aa111aab2d8f7da1eb8cb6219d5a57f","original_commit_id":"658db5b1ee559be504db1cc85aa622797f4a653e","user":{"login":"hzxuzhonghu","id":13374016,"node_id":"MDQ6VXNlcjEzMzc0MDE2","avatar_url":"https://avatars3.githubusercontent.com/u/13374016?v=4","gravatar_id":"","url":"https://api.github.com/users/hzxuzhonghu","html_url":"https://github.com/hzxuzhonghu","followers_url":"https://api.github.com/users/hzxuzhonghu/followers","following_url":"https://api.github.com/users/hzxuzhonghu/following{/other_user}","gists_url":"https://api.github.com/users/hzxuzhonghu/gists{/gist_id}","starred_url":"https://api.github.com/users/hzxuzhonghu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzxuzhonghu/subscriptions","organizations_url":"https://api.github.com/users/hzxuzhonghu/orgs","repos_url":"https://api.github.com/users/hzxuzhonghu/repos","events_url":"https://api.github.com/users/hzxuzhonghu/events{/privacy}","received_events_url":"https://api.github.com/users/hzxuzhonghu/received_events","type":"User","site_admin":false},"body":"To be clear if you indeed want to do `concurrency  * repeat`  request, better to implement as following, which can reduce the blocking go routines at some point.\r\n```\r\nfor i := 0; i < rootArgs.repeat; i++ {\r\n    for c := 0; c < rootArgs.concurrency; c++ {\r\n           rl.Wait(context.Background())\r\n           go func(){\r\n           ........\r\n```","created_at":"2018-09-28T11:09:56Z","updated_at":"2018-09-28T11:09:56Z","html_url":"https://github.com/istio/istio/pull/9021#discussion_r221218662","pull_request_url":"https://api.github.com/repos/istio/istio/pulls/9021","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/comments/221218662"},"html":{"href":"https://github.com/istio/istio/pull/9021#discussion_r221218662"},"pull_request":{"href":"https://api.github.com/repos/istio/istio/pulls/9021"}},"in_reply_to_id":221132978},"pull_request":{"url":"https://api.github.com/repos/istio/istio/pulls/9021","id":218818854,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4ODE4ODU0","html_url":"https://github.com/istio/istio/pull/9021","diff_url":"https://github.com/istio/istio/pull/9021.diff","patch_url":"https://github.com/istio/istio/pull/9021.patch","issue_url":"https://api.github.com/repos/istio/istio/issues/9021","number":9021,"state":"open","locked":false,"title":"Add concurrency and rate to mixc","user":{"login":"bianpengyuan","id":34738376,"node_id":"MDQ6VXNlcjM0NzM4Mzc2","avatar_url":"https://avatars2.githubusercontent.com/u/34738376?v=4","gravatar_id":"","url":"https://api.github.com/users/bianpengyuan","html_url":"https://github.com/bianpengyuan","followers_url":"https://api.github.com/users/bianpengyuan/followers","following_url":"https://api.github.com/users/bianpengyuan/following{/other_user}","gists_url":"https://api.github.com/users/bianpengyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/bianpengyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bianpengyuan/subscriptions","organizations_url":"https://api.github.com/users/bianpengyuan/orgs","repos_url":"https://api.github.com/users/bianpengyuan/repos","events_url":"https://api.github.com/users/bianpengyuan/events{/privacy}","received_events_url":"https://api.github.com/users/bianpengyuan/received_events","type":"User","site_admin":false},"body":"This is to make mixc binary to generate controllable load to facilitate mixer perf test (for instance, #8829)","created_at":"2018-09-27T23:50:08Z","updated_at":"2018-09-28T11:09:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf7a37db0dbb6c068ea22786d41d2177a1f28eeb","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mandarjog","id":800375,"node_id":"MDQ6VXNlcjgwMDM3NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/800375?v=4","gravatar_id":"","url":"https://api.github.com/users/mandarjog","html_url":"https://github.com/mandarjog","followers_url":"https://api.github.com/users/mandarjog/followers","following_url":"https://api.github.com/users/mandarjog/following{/other_user}","gists_url":"https://api.github.com/users/mandarjog/gists{/gist_id}","starred_url":"https://api.github.com/users/mandarjog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandarjog/subscriptions","organizations_url":"https://api.github.com/users/mandarjog/orgs","repos_url":"https://api.github.com/users/mandarjog/repos","events_url":"https://api.github.com/users/mandarjog/events{/privacy}","received_events_url":"https://api.github.com/users/mandarjog/received_events","type":"User","site_admin":false},{"login":"kyessenov","id":9537734,"node_id":"MDQ6VXNlcjk1Mzc3MzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9537734?v=4","gravatar_id":"","url":"https://api.github.com/users/kyessenov","html_url":"https://github.com/kyessenov","followers_url":"https://api.github.com/users/kyessenov/followers","following_url":"https://api.github.com/users/kyessenov/following{/other_user}","gists_url":"https://api.github.com/users/kyessenov/gists{/gist_id}","starred_url":"https://api.github.com/users/kyessenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyessenov/subscriptions","organizations_url":"https://api.github.com/users/kyessenov/orgs","repos_url":"https://api.github.com/users/kyessenov/repos","events_url":"https://api.github.com/users/kyessenov/events{/privacy}","received_events_url":"https://api.github.com/users/kyessenov/received_events","type":"User","site_admin":false},{"login":"douglas-reid","id":21148125,"node_id":"MDQ6VXNlcjIxMTQ4MTI1","avatar_url":"https://avatars3.githubusercontent.com/u/21148125?v=4","gravatar_id":"","url":"https://api.github.com/users/douglas-reid","html_url":"https://github.com/douglas-reid","followers_url":"https://api.github.com/users/douglas-reid/followers","following_url":"https://api.github.com/users/douglas-reid/following{/other_user}","gists_url":"https://api.github.com/users/douglas-reid/gists{/gist_id}","starred_url":"https://api.github.com/users/douglas-reid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/douglas-reid/subscriptions","organizations_url":"https://api.github.com/users/douglas-reid/orgs","repos_url":"https://api.github.com/users/douglas-reid/repos","events_url":"https://api.github.com/users/douglas-reid/events{/privacy}","received_events_url":"https://api.github.com/users/douglas-reid/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":491318011,"node_id":"MDU6TGFiZWw0OTEzMTgwMTE=","url":"https://api.github.com/repos/istio/istio/labels/cla:%20yes","name":"cla: yes","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/istio/istio/pulls/9021/commits","review_comments_url":"https://api.github.com/repos/istio/istio/pulls/9021/comments","review_comment_url":"https://api.github.com/repos/istio/istio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/istio/issues/9021/comments","statuses_url":"https://api.github.com/repos/istio/istio/statuses/606c4cca4aa111aab2d8f7da1eb8cb6219d5a57f","head":{"label":"bianpengyuan:perf-test","ref":"perf-test","sha":"606c4cca4aa111aab2d8f7da1eb8cb6219d5a57f","user":{"login":"bianpengyuan","id":34738376,"node_id":"MDQ6VXNlcjM0NzM4Mzc2","avatar_url":"https://avatars2.githubusercontent.com/u/34738376?v=4","gravatar_id":"","url":"https://api.github.com/users/bianpengyuan","html_url":"https://github.com/bianpengyuan","followers_url":"https://api.github.com/users/bianpengyuan/followers","following_url":"https://api.github.com/users/bianpengyuan/following{/other_user}","gists_url":"https://api.github.com/users/bianpengyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/bianpengyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bianpengyuan/subscriptions","organizations_url":"https://api.github.com/users/bianpengyuan/orgs","repos_url":"https://api.github.com/users/bianpengyuan/repos","events_url":"https://api.github.com/users/bianpengyuan/events{/privacy}","received_events_url":"https://api.github.com/users/bianpengyuan/received_events","type":"User","site_admin":false},"repo":{"id":120412640,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA0MTI2NDA=","name":"istio","full_name":"bianpengyuan/istio","private":false,"owner":{"login":"bianpengyuan","id":34738376,"node_id":"MDQ6VXNlcjM0NzM4Mzc2","avatar_url":"https://avatars2.githubusercontent.com/u/34738376?v=4","gravatar_id":"","url":"https://api.github.com/users/bianpengyuan","html_url":"https://github.com/bianpengyuan","followers_url":"https://api.github.com/users/bianpengyuan/followers","following_url":"https://api.github.com/users/bianpengyuan/following{/other_user}","gists_url":"https://api.github.com/users/bianpengyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/bianpengyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bianpengyuan/subscriptions","organizations_url":"https://api.github.com/users/bianpengyuan/orgs","repos_url":"https://api.github.com/users/bianpengyuan/repos","events_url":"https://api.github.com/users/bianpengyuan/events{/privacy}","received_events_url":"https://api.github.com/users/bianpengyuan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bianpengyuan/istio","description":"An open platform to connect, manage, and secure microservices.","fork":true,"url":"https://api.github.com/repos/bianpengyuan/istio","forks_url":"https://api.github.com/repos/bianpengyuan/istio/forks","keys_url":"https://api.github.com/repos/bianpengyuan/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bianpengyuan/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bianpengyuan/istio/teams","hooks_url":"https://api.github.com/repos/bianpengyuan/istio/hooks","issue_events_url":"https://api.github.com/repos/bianpengyuan/istio/issues/events{/number}","events_url":"https://api.github.com/repos/bianpengyuan/istio/events","assignees_url":"https://api.github.com/repos/bianpengyuan/istio/assignees{/user}","branches_url":"https://api.github.com/repos/bianpengyuan/istio/branches{/branch}","tags_url":"https://api.github.com/repos/bianpengyuan/istio/tags","blobs_url":"https://api.github.com/repos/bianpengyuan/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bianpengyuan/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bianpengyuan/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/bianpengyuan/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bianpengyuan/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/bianpengyuan/istio/languages","stargazers_url":"https://api.github.com/repos/bianpengyuan/istio/stargazers","contributors_url":"https://api.github.com/repos/bianpengyuan/istio/contributors","subscribers_url":"https://api.github.com/repos/bianpengyuan/istio/subscribers","subscription_url":"https://api.github.com/repos/bianpengyuan/istio/subscription","commits_url":"https://api.github.com/repos/bianpengyuan/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/bianpengyuan/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/bianpengyuan/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/bianpengyuan/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/bianpengyuan/istio/contents/{+path}","compare_url":"https://api.github.com/repos/bianpengyuan/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bianpengyuan/istio/merges","archive_url":"https://api.github.com/repos/bianpengyuan/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bianpengyuan/istio/downloads","issues_url":"https://api.github.com/repos/bianpengyuan/istio/issues{/number}","pulls_url":"https://api.github.com/repos/bianpengyuan/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/bianpengyuan/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/bianpengyuan/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bianpengyuan/istio/labels{/name}","releases_url":"https://api.github.com/repos/bianpengyuan/istio/releases{/id}","deployments_url":"https://api.github.com/repos/bianpengyuan/istio/deployments","created_at":"2018-02-06T06:36:33Z","updated_at":"2018-08-16T22:44:49Z","pushed_at":"2018-09-28T05:27:11Z","git_url":"git://github.com/bianpengyuan/istio.git","ssh_url":"git@github.com:bianpengyuan/istio.git","clone_url":"https://github.com/bianpengyuan/istio.git","svn_url":"https://github.com/bianpengyuan/istio","homepage":"https://istio.io","size":57715,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"istio:master","ref":"master","sha":"65d31f2fcdc6ccf94331fcd6d7a1e8b8f988d803","user":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":74175805,"node_id":"MDEwOlJlcG9zaXRvcnk3NDE3NTgwNQ==","name":"istio","full_name":"istio/istio","private":false,"owner":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/istio/istio","description":"Connect, secure, control, and observe services.","fork":false,"url":"https://api.github.com/repos/istio/istio","forks_url":"https://api.github.com/repos/istio/istio/forks","keys_url":"https://api.github.com/repos/istio/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/istio/teams","hooks_url":"https://api.github.com/repos/istio/istio/hooks","issue_events_url":"https://api.github.com/repos/istio/istio/issues/events{/number}","events_url":"https://api.github.com/repos/istio/istio/events","assignees_url":"https://api.github.com/repos/istio/istio/assignees{/user}","branches_url":"https://api.github.com/repos/istio/istio/branches{/branch}","tags_url":"https://api.github.com/repos/istio/istio/tags","blobs_url":"https://api.github.com/repos/istio/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/istio/languages","stargazers_url":"https://api.github.com/repos/istio/istio/stargazers","contributors_url":"https://api.github.com/repos/istio/istio/contributors","subscribers_url":"https://api.github.com/repos/istio/istio/subscribers","subscription_url":"https://api.github.com/repos/istio/istio/subscription","commits_url":"https://api.github.com/repos/istio/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/istio/contents/{+path}","compare_url":"https://api.github.com/repos/istio/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/istio/merges","archive_url":"https://api.github.com/repos/istio/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/istio/downloads","issues_url":"https://api.github.com/repos/istio/istio/issues{/number}","pulls_url":"https://api.github.com/repos/istio/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/istio/labels{/name}","releases_url":"https://api.github.com/repos/istio/istio/releases{/id}","deployments_url":"https://api.github.com/repos/istio/istio/deployments","created_at":"2016-11-18T23:57:21Z","updated_at":"2018-09-28T09:43:48Z","pushed_at":"2018-09-28T08:38:31Z","git_url":"git://github.com/istio/istio.git","ssh_url":"git@github.com:istio/istio.git","clone_url":"https://github.com/istio/istio.git","svn_url":"https://github.com/istio/istio","homepage":"https://istio.io","size":49593,"stargazers_count":12011,"watchers_count":12011,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1769,"mirror_url":null,"archived":false,"open_issues_count":958,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1769,"open_issues":958,"watchers":12011,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/9021"},"html":{"href":"https://github.com/istio/istio/pull/9021"},"issue":{"href":"https://api.github.com/repos/istio/istio/issues/9021"},"comments":{"href":"https://api.github.com/repos/istio/istio/issues/9021/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/istio/pulls/9021/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/istio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/istio/pulls/9021/commits"},"statuses":{"href":"https://api.github.com/repos/istio/istio/statuses/606c4cca4aa111aab2d8f7da1eb8cb6219d5a57f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hzxuzhonghu"}}