{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc-go/pulls/comments/290078741","pull_request_review_id":245173391,"id":290078741,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5MDA3ODc0MQ==","diff_hunk":"@@ -648,76 +659,42 @@ func setCompressorMode(val string) []string {\n \t}\n }\n \n-func printThroughput(requestCount uint64, requestSize int, responseCount uint64, responseSize int, benchTime time.Duration) {\n-\trequestThroughput := float64(requestCount) * float64(requestSize) * 8 / benchTime.Seconds()\n-\tresponseThroughput := float64(responseCount) * float64(responseSize) * 8 / benchTime.Seconds()\n-\tfmt.Printf(\"Number of requests:  %v\\tRequest throughput:  %v bit/s\\n\", requestCount, requestThroughput)\n-\tfmt.Printf(\"Number of responses: %v\\tResponse throughput: %v bit/s\\n\", responseCount, responseThroughput)\n-\tfmt.Println()\n-}\n-\n func main() {\n \topts := processFlags()\n \tbefore(opts)\n+\n \ts := stats.NewStats(numStatsBuckets)\n-\ts.SortLatency()\n-\tvar memStats runtime.MemStats\n-\tvar results testing.BenchmarkResult\n-\tvar startAllocs, startBytes uint64\n-\tvar startTime time.Time\n-\tvar startTimer = func() {\n-\t\truntime.ReadMemStats(&memStats)\n-\t\tstartAllocs = memStats.Mallocs\n-\t\tstartBytes = memStats.TotalAlloc\n-\t\tstartTime = time.Now()\n-\t}\n-\tvar stopTimer = func(count uint64) {\n-\t\truntime.ReadMemStats(&memStats)\n-\t\tresults = testing.BenchmarkResult{\n-\t\t\tN:         int(count),\n-\t\t\tT:         time.Since(startTime),\n-\t\t\tBytes:     0,\n-\t\t\tMemAllocs: memStats.Mallocs - startAllocs,\n-\t\t\tMemBytes:  memStats.TotalAlloc - startBytes,\n+\tfeaturesNum := makeFeaturesNum(opts)\n+\tsf := sharedFeatures(featuresNum)\n+\tmode := \"\"\n+\n+\tvar (\n+\t\tmakeStart = func(mode string, bf stats.Features) func() {\n+\t\t\treturn func() { s.StartRun(mode, bf, sf) }","path":"benchmark/benchmain/main.go","position":542,"original_position":542,"commit_id":"9714673ce0e4f3fdc675a127fd1521a0e7c59a35","original_commit_id":"9714673ce0e4f3fdc675a127fd1521a0e7c59a35","user":{"login":"canguler","id":7987187,"node_id":"MDQ6VXNlcjc5ODcxODc=","avatar_url":"https://avatars2.githubusercontent.com/u/7987187?v=4","gravatar_id":"","url":"https://api.github.com/users/canguler","html_url":"https://github.com/canguler","followers_url":"https://api.github.com/users/canguler/followers","following_url":"https://api.github.com/users/canguler/following{/other_user}","gists_url":"https://api.github.com/users/canguler/gists{/gist_id}","starred_url":"https://api.github.com/users/canguler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canguler/subscriptions","organizations_url":"https://api.github.com/users/canguler/orgs","repos_url":"https://api.github.com/users/canguler/repos","events_url":"https://api.github.com/users/canguler/events{/privacy}","received_events_url":"https://api.github.com/users/canguler/received_events","type":"User","site_admin":false},"body":"For me, an even better approach will be the following.\r\nMake the type `startFunc` to be `func(string, stats.Features)`\r\ndefine `start` as\r\n```golang\r\nstart = func(mode string, bf stats.Features) {s.StartRun(mode, bf, sf)}\r\n```\r\n\r\nin `unconstrainedStreamBenchmark`, when calling `start` `mode` will always be `workloadsUnconstrained`\r\n\r\n`runBenchmark` will get a `mode` parameter from `unaryBenchmark` and from `streamBenchmark` and will call `start` with that parameter.","created_at":"2019-06-03T23:38:22Z","updated_at":"2019-06-03T23:42:17Z","html_url":"https://github.com/grpc/grpc-go/pull/2840#discussion_r290078741","pull_request_url":"https://api.github.com/repos/grpc/grpc-go/pulls/2840","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/comments/290078741"},"html":{"href":"https://github.com/grpc/grpc-go/pull/2840#discussion_r290078741"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/2840"}},"in_reply_to_id":290077734},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc-go/pulls/2840","id":283482766,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgzNDgyNzY2","html_url":"https://github.com/grpc/grpc-go/pull/2840","diff_url":"https://github.com/grpc/grpc-go/pull/2840.diff","patch_url":"https://github.com/grpc/grpc-go/pull/2840.patch","issue_url":"https://api.github.com/repos/grpc/grpc-go/issues/2840","number":2840,"state":"open","locked":false,"title":"A few more improvements to the benchmark code.","user":{"login":"easwars","id":1638487,"node_id":"MDQ6VXNlcjE2Mzg0ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/1638487?v=4","gravatar_id":"","url":"https://api.github.com/users/easwars","html_url":"https://github.com/easwars","followers_url":"https://api.github.com/users/easwars/followers","following_url":"https://api.github.com/users/easwars/following{/other_user}","gists_url":"https://api.github.com/users/easwars/gists{/gist_id}","starred_url":"https://api.github.com/users/easwars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/easwars/subscriptions","organizations_url":"https://api.github.com/users/easwars/orgs","repos_url":"https://api.github.com/users/easwars/repos","events_url":"https://api.github.com/users/easwars/events{/privacy}","received_events_url":"https://api.github.com/users/easwars/received_events","type":"User","site_admin":false},"body":"- In benchmain/main.go:\r\n  -  Define types for function arguments to make code more readable\r\n  -  Significantly simplify the code as a result of stats package refactor.\r\n-  In benchresult/main.go\r\n  -  Simplify code as a result of stats package refactor.\r\n- In stats/stats.go\r\n  - Define and expose featureIndex enum.\r\n  - Refactor the types used to store features, results, stats etc.\r\n  - Track stats for unconstrained workloads.\r\n  - Provide easy to use methods to add/modify/read/dump stats info.\r\n- Delete stats/util.go - dead code.\r\n","created_at":"2019-05-30T01:15:50Z","updated_at":"2019-06-03T23:42:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ad109bbd7c32f01522fe8e4569577b05a14a768","assignee":{"login":"canguler","id":7987187,"node_id":"MDQ6VXNlcjc5ODcxODc=","avatar_url":"https://avatars2.githubusercontent.com/u/7987187?v=4","gravatar_id":"","url":"https://api.github.com/users/canguler","html_url":"https://github.com/canguler","followers_url":"https://api.github.com/users/canguler/followers","following_url":"https://api.github.com/users/canguler/following{/other_user}","gists_url":"https://api.github.com/users/canguler/gists{/gist_id}","starred_url":"https://api.github.com/users/canguler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canguler/subscriptions","organizations_url":"https://api.github.com/users/canguler/orgs","repos_url":"https://api.github.com/users/canguler/repos","events_url":"https://api.github.com/users/canguler/events{/privacy}","received_events_url":"https://api.github.com/users/canguler/received_events","type":"User","site_admin":false},"assignees":[{"login":"canguler","id":7987187,"node_id":"MDQ6VXNlcjc5ODcxODc=","avatar_url":"https://avatars2.githubusercontent.com/u/7987187?v=4","gravatar_id":"","url":"https://api.github.com/users/canguler","html_url":"https://github.com/canguler","followers_url":"https://api.github.com/users/canguler/followers","following_url":"https://api.github.com/users/canguler/following{/other_user}","gists_url":"https://api.github.com/users/canguler/gists{/gist_id}","starred_url":"https://api.github.com/users/canguler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canguler/subscriptions","organizations_url":"https://api.github.com/users/canguler/orgs","repos_url":"https://api.github.com/users/canguler/repos","events_url":"https://api.github.com/users/canguler/events{/privacy}","received_events_url":"https://api.github.com/users/canguler/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc-go/pulls/2840/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc-go/pulls/2840/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc-go/issues/2840/comments","statuses_url":"https://api.github.com/repos/grpc/grpc-go/statuses/9714673ce0e4f3fdc675a127fd1521a0e7c59a35","head":{"label":"easwars:benchmark","ref":"benchmark","sha":"9714673ce0e4f3fdc675a127fd1521a0e7c59a35","user":{"login":"easwars","id":1638487,"node_id":"MDQ6VXNlcjE2Mzg0ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/1638487?v=4","gravatar_id":"","url":"https://api.github.com/users/easwars","html_url":"https://github.com/easwars","followers_url":"https://api.github.com/users/easwars/followers","following_url":"https://api.github.com/users/easwars/following{/other_user}","gists_url":"https://api.github.com/users/easwars/gists{/gist_id}","starred_url":"https://api.github.com/users/easwars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/easwars/subscriptions","organizations_url":"https://api.github.com/users/easwars/orgs","repos_url":"https://api.github.com/users/easwars/repos","events_url":"https://api.github.com/users/easwars/events{/privacy}","received_events_url":"https://api.github.com/users/easwars/received_events","type":"User","site_admin":false},"repo":{"id":178435408,"node_id":"MDEwOlJlcG9zaXRvcnkxNzg0MzU0MDg=","name":"grpc-go","full_name":"easwars/grpc-go","private":false,"owner":{"login":"easwars","id":1638487,"node_id":"MDQ6VXNlcjE2Mzg0ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/1638487?v=4","gravatar_id":"","url":"https://api.github.com/users/easwars","html_url":"https://github.com/easwars","followers_url":"https://api.github.com/users/easwars/followers","following_url":"https://api.github.com/users/easwars/following{/other_user}","gists_url":"https://api.github.com/users/easwars/gists{/gist_id}","starred_url":"https://api.github.com/users/easwars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/easwars/subscriptions","organizations_url":"https://api.github.com/users/easwars/orgs","repos_url":"https://api.github.com/users/easwars/repos","events_url":"https://api.github.com/users/easwars/events{/privacy}","received_events_url":"https://api.github.com/users/easwars/received_events","type":"User","site_admin":false},"html_url":"https://github.com/easwars/grpc-go","description":"The Go language implementation of gRPC. HTTP/2 based RPC","fork":true,"url":"https://api.github.com/repos/easwars/grpc-go","forks_url":"https://api.github.com/repos/easwars/grpc-go/forks","keys_url":"https://api.github.com/repos/easwars/grpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/easwars/grpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/easwars/grpc-go/teams","hooks_url":"https://api.github.com/repos/easwars/grpc-go/hooks","issue_events_url":"https://api.github.com/repos/easwars/grpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/easwars/grpc-go/events","assignees_url":"https://api.github.com/repos/easwars/grpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/easwars/grpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/easwars/grpc-go/tags","blobs_url":"https://api.github.com/repos/easwars/grpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/easwars/grpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/easwars/grpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/easwars/grpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/easwars/grpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/easwars/grpc-go/languages","stargazers_url":"https://api.github.com/repos/easwars/grpc-go/stargazers","contributors_url":"https://api.github.com/repos/easwars/grpc-go/contributors","subscribers_url":"https://api.github.com/repos/easwars/grpc-go/subscribers","subscription_url":"https://api.github.com/repos/easwars/grpc-go/subscription","commits_url":"https://api.github.com/repos/easwars/grpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/easwars/grpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/easwars/grpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/easwars/grpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/easwars/grpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/easwars/grpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/easwars/grpc-go/merges","archive_url":"https://api.github.com/repos/easwars/grpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/easwars/grpc-go/downloads","issues_url":"https://api.github.com/repos/easwars/grpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/easwars/grpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/easwars/grpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/easwars/grpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/easwars/grpc-go/labels{/name}","releases_url":"https://api.github.com/repos/easwars/grpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/easwars/grpc-go/deployments","created_at":"2019-03-29T15:55:29Z","updated_at":"2019-05-30T19:26:44Z","pushed_at":"2019-06-03T20:19:14Z","git_url":"git://github.com/easwars/grpc-go.git","ssh_url":"git@github.com:easwars/grpc-go.git","clone_url":"https://github.com/easwars/grpc-go.git","svn_url":"https://github.com/easwars/grpc-go","homepage":"","size":8119,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":1,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"0435a4bb26ac754b679412c2d7f93748b99897ca","user":{"login":"grpc","id":7802525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4MDI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729907,"node_id":"MDEwOlJlcG9zaXRvcnkyNzcyOTkwNw==","name":"grpc-go","full_name":"grpc/grpc-go","private":false,"owner":{"login":"grpc","id":7802525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4MDI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/grpc/grpc-go","description":"The Go language implementation of gRPC. HTTP/2 based RPC","fork":false,"url":"https://api.github.com/repos/grpc/grpc-go","forks_url":"https://api.github.com/repos/grpc/grpc-go/forks","keys_url":"https://api.github.com/repos/grpc/grpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc-go/teams","hooks_url":"https://api.github.com/repos/grpc/grpc-go/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc-go/events","assignees_url":"https://api.github.com/repos/grpc/grpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc-go/tags","blobs_url":"https://api.github.com/repos/grpc/grpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc-go/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc-go/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc-go/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc-go/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc-go/subscription","commits_url":"https://api.github.com/repos/grpc/grpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc-go/merges","archive_url":"https://api.github.com/repos/grpc/grpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc-go/downloads","issues_url":"https://api.github.com/repos/grpc/grpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc-go/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc-go/deployments","created_at":"2014-12-08T18:59:34Z","updated_at":"2019-06-03T19:44:26Z","pushed_at":"2019-06-03T22:07:43Z","git_url":"git://github.com/grpc/grpc-go.git","ssh_url":"git@github.com:grpc/grpc-go.git","clone_url":"https://github.com/grpc/grpc-go.git","svn_url":"https://github.com/grpc/grpc-go","homepage":"https://grpc.io","size":8896,"stargazers_count":8437,"watchers_count":8437,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1666,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":127,"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":1666,"open_issues":127,"watchers":8437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/2840"},"html":{"href":"https://github.com/grpc/grpc-go/pull/2840"},"issue":{"href":"https://api.github.com/repos/grpc/grpc-go/issues/2840"},"comments":{"href":"https://api.github.com/repos/grpc/grpc-go/issues/2840/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/2840/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/2840/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc-go/statuses/9714673ce0e4f3fdc675a127fd1521a0e7c59a35"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"canguler"}}