{"action":"created","comment":{"url":"https://api.github.com/repos/twitter/rpc-perf/pulls/comments/204870836","pull_request_review_id":140025676,"id":204870836,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDg3MDgzNg==","diff_hunk":"@@ -159,12 +159,25 @@ pub fn extract_parameter<T: Ptype>(\n         },\n     );\n \n+    let num = parameter.get(\"num\").and_then(|k| k.as_integer()).map_or(\n+        0,\n+        |i| {\n+            i as u64\n+        },\n+    );\n+\n+    // size is insufficient to contain num strings\n+    if format!(\"{}\", num - 1).len() > size {\n+        return Err(format!(\"size {} insufficient to contain {} strings\",\n+                           size, num));\n+    }\n+\n     let regenerate = parameter\n         .get(\"regenerate\")\n         .and_then(|k| k.as_bool())\n         .unwrap_or(false);\n \n-    let mut value = try!(T::parse(seed, size, parameter));\n+    let mut value = try!(T::parse(seed, size, num, parameter));","path":"src/cfgtypes/mod.rs","position":32,"original_position":32,"commit_id":"bc68d81be0a5438c466849d805483bfd7ae65973","original_commit_id":"bc68d81be0a5438c466849d805483bfd7ae65973","user":{"login":"slyphon","id":46660,"node_id":"MDQ6VXNlcjQ2NjYw","avatar_url":"https://avatars2.githubusercontent.com/u/46660?v=4","gravatar_id":"","url":"https://api.github.com/users/slyphon","html_url":"https://github.com/slyphon","followers_url":"https://api.github.com/users/slyphon/followers","following_url":"https://api.github.com/users/slyphon/following{/other_user}","gists_url":"https://api.github.com/users/slyphon/gists{/gist_id}","starred_url":"https://api.github.com/users/slyphon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slyphon/subscriptions","organizations_url":"https://api.github.com/users/slyphon/orgs","repos_url":"https://api.github.com/users/slyphon/repos","events_url":"https://api.github.com/users/slyphon/events{/privacy}","received_events_url":"https://api.github.com/users/slyphon/received_events","type":"User","site_admin":false},"body":"Since this method returns `Result<T>`, we can use the new `?` macro instead of `try!` (which is deprecated now, afaict).\r\n\r\n```rust\r\nlet mut value = T::parse(seed, size, num, parameter)?;\r\n```","created_at":"2018-07-24T18:48:19Z","updated_at":"2018-07-24T19:04:26Z","html_url":"https://github.com/twitter/rpc-perf/pull/153#discussion_r204870836","pull_request_url":"https://api.github.com/repos/twitter/rpc-perf/pulls/153","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/twitter/rpc-perf/pulls/comments/204870836"},"html":{"href":"https://github.com/twitter/rpc-perf/pull/153#discussion_r204870836"},"pull_request":{"href":"https://api.github.com/repos/twitter/rpc-perf/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/twitter/rpc-perf/pulls/153","id":203424759,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNDI0NzU5","html_url":"https://github.com/twitter/rpc-perf/pull/153","diff_url":"https://github.com/twitter/rpc-perf/pull/153.diff","patch_url":"https://github.com/twitter/rpc-perf/pull/153.patch","issue_url":"https://api.github.com/repos/twitter/rpc-perf/issues/153","number":153,"state":"open","locked":false,"title":"add support for explicitly sized random data sets","user":{"login":"kevyang","id":2468631,"node_id":"MDQ6VXNlcjI0Njg2MzE=","avatar_url":"https://avatars3.githubusercontent.com/u/2468631?v=4","gravatar_id":"","url":"https://api.github.com/users/kevyang","html_url":"https://github.com/kevyang","followers_url":"https://api.github.com/users/kevyang/followers","following_url":"https://api.github.com/users/kevyang/following{/other_user}","gists_url":"https://api.github.com/users/kevyang/gists{/gist_id}","starred_url":"https://api.github.com/users/kevyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevyang/subscriptions","organizations_url":"https://api.github.com/users/kevyang/orgs","repos_url":"https://api.github.com/users/kevyang/repos","events_url":"https://api.github.com/users/kevyang/events{/privacy}","received_events_url":"https://api.github.com/users/kevyang/received_events","type":"User","site_admin":false},"body":"This change adds support for randomly generated strings to be from a dataset of size n. For this to happen, random workloads will take an additional `num` parameter which specifies the data set size. For example, with `num == 1_000_000`, the random workload will generate strings from a set of 1,000,000 strings. This will be useful for performance testing caches at different levels of heap utilization. \r\n\r\nI didn't find any documentation on how to configure workloads, so I added the details in an example configuration. Please let me know if there is a better place for this. I am a beginner at rust, so please let me know if anything I am writing is non idiomatic/incorrect. ","created_at":"2018-07-24T06:43:22Z","updated_at":"2018-07-24T19:04:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fc4ffbb98ab0fafcb45e78936f9b15b6be2287b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/twitter/rpc-perf/pulls/153/commits","review_comments_url":"https://api.github.com/repos/twitter/rpc-perf/pulls/153/comments","review_comment_url":"https://api.github.com/repos/twitter/rpc-perf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twitter/rpc-perf/issues/153/comments","statuses_url":"https://api.github.com/repos/twitter/rpc-perf/statuses/bc68d81be0a5438c466849d805483bfd7ae65973","head":{"label":"kevyang:151","ref":"151","sha":"bc68d81be0a5438c466849d805483bfd7ae65973","user":{"login":"kevyang","id":2468631,"node_id":"MDQ6VXNlcjI0Njg2MzE=","avatar_url":"https://avatars3.githubusercontent.com/u/2468631?v=4","gravatar_id":"","url":"https://api.github.com/users/kevyang","html_url":"https://github.com/kevyang","followers_url":"https://api.github.com/users/kevyang/followers","following_url":"https://api.github.com/users/kevyang/following{/other_user}","gists_url":"https://api.github.com/users/kevyang/gists{/gist_id}","starred_url":"https://api.github.com/users/kevyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevyang/subscriptions","organizations_url":"https://api.github.com/users/kevyang/orgs","repos_url":"https://api.github.com/users/kevyang/repos","events_url":"https://api.github.com/users/kevyang/events{/privacy}","received_events_url":"https://api.github.com/users/kevyang/received_events","type":"User","site_admin":false},"repo":{"id":140888622,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA4ODg2MjI=","name":"rpc-perf","full_name":"kevyang/rpc-perf","owner":{"login":"kevyang","id":2468631,"node_id":"MDQ6VXNlcjI0Njg2MzE=","avatar_url":"https://avatars3.githubusercontent.com/u/2468631?v=4","gravatar_id":"","url":"https://api.github.com/users/kevyang","html_url":"https://github.com/kevyang","followers_url":"https://api.github.com/users/kevyang/followers","following_url":"https://api.github.com/users/kevyang/following{/other_user}","gists_url":"https://api.github.com/users/kevyang/gists{/gist_id}","starred_url":"https://api.github.com/users/kevyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevyang/subscriptions","organizations_url":"https://api.github.com/users/kevyang/orgs","repos_url":"https://api.github.com/users/kevyang/repos","events_url":"https://api.github.com/users/kevyang/events{/privacy}","received_events_url":"https://api.github.com/users/kevyang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kevyang/rpc-perf","description":"A tool for benchmarking RPC services","fork":true,"url":"https://api.github.com/repos/kevyang/rpc-perf","forks_url":"https://api.github.com/repos/kevyang/rpc-perf/forks","keys_url":"https://api.github.com/repos/kevyang/rpc-perf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kevyang/rpc-perf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kevyang/rpc-perf/teams","hooks_url":"https://api.github.com/repos/kevyang/rpc-perf/hooks","issue_events_url":"https://api.github.com/repos/kevyang/rpc-perf/issues/events{/number}","events_url":"https://api.github.com/repos/kevyang/rpc-perf/events","assignees_url":"https://api.github.com/repos/kevyang/rpc-perf/assignees{/user}","branches_url":"https://api.github.com/repos/kevyang/rpc-perf/branches{/branch}","tags_url":"https://api.github.com/repos/kevyang/rpc-perf/tags","blobs_url":"https://api.github.com/repos/kevyang/rpc-perf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kevyang/rpc-perf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kevyang/rpc-perf/git/refs{/sha}","trees_url":"https://api.github.com/repos/kevyang/rpc-perf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kevyang/rpc-perf/statuses/{sha}","languages_url":"https://api.github.com/repos/kevyang/rpc-perf/languages","stargazers_url":"https://api.github.com/repos/kevyang/rpc-perf/stargazers","contributors_url":"https://api.github.com/repos/kevyang/rpc-perf/contributors","subscribers_url":"https://api.github.com/repos/kevyang/rpc-perf/subscribers","subscription_url":"https://api.github.com/repos/kevyang/rpc-perf/subscription","commits_url":"https://api.github.com/repos/kevyang/rpc-perf/commits{/sha}","git_commits_url":"https://api.github.com/repos/kevyang/rpc-perf/git/commits{/sha}","comments_url":"https://api.github.com/repos/kevyang/rpc-perf/comments{/number}","issue_comment_url":"https://api.github.com/repos/kevyang/rpc-perf/issues/comments{/number}","contents_url":"https://api.github.com/repos/kevyang/rpc-perf/contents/{+path}","compare_url":"https://api.github.com/repos/kevyang/rpc-perf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kevyang/rpc-perf/merges","archive_url":"https://api.github.com/repos/kevyang/rpc-perf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kevyang/rpc-perf/downloads","issues_url":"https://api.github.com/repos/kevyang/rpc-perf/issues{/number}","pulls_url":"https://api.github.com/repos/kevyang/rpc-perf/pulls{/number}","milestones_url":"https://api.github.com/repos/kevyang/rpc-perf/milestones{/number}","notifications_url":"https://api.github.com/repos/kevyang/rpc-perf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kevyang/rpc-perf/labels{/name}","releases_url":"https://api.github.com/repos/kevyang/rpc-perf/releases{/id}","deployments_url":"https://api.github.com/repos/kevyang/rpc-perf/deployments","created_at":"2018-07-13T20:06:47Z","updated_at":"2018-07-13T20:06:49Z","pushed_at":"2018-07-24T06:39:21Z","git_url":"git://github.com/kevyang/rpc-perf.git","ssh_url":"git@github.com:kevyang/rpc-perf.git","clone_url":"https://github.com/kevyang/rpc-perf.git","svn_url":"https://github.com/kevyang/rpc-perf","homepage":null,"size":506,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"twitter:master","ref":"master","sha":"8708682a73efae7d91e5d17a9867e7d1c770482f","user":{"login":"twitter","id":50278,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMjc4","avatar_url":"https://avatars1.githubusercontent.com/u/50278?v=4","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":46767238,"node_id":"MDEwOlJlcG9zaXRvcnk0Njc2NzIzOA==","name":"rpc-perf","full_name":"twitter/rpc-perf","owner":{"login":"twitter","id":50278,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMjc4","avatar_url":"https://avatars1.githubusercontent.com/u/50278?v=4","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twitter/rpc-perf","description":"A tool for benchmarking RPC services","fork":false,"url":"https://api.github.com/repos/twitter/rpc-perf","forks_url":"https://api.github.com/repos/twitter/rpc-perf/forks","keys_url":"https://api.github.com/repos/twitter/rpc-perf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/rpc-perf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/rpc-perf/teams","hooks_url":"https://api.github.com/repos/twitter/rpc-perf/hooks","issue_events_url":"https://api.github.com/repos/twitter/rpc-perf/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/rpc-perf/events","assignees_url":"https://api.github.com/repos/twitter/rpc-perf/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/rpc-perf/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/rpc-perf/tags","blobs_url":"https://api.github.com/repos/twitter/rpc-perf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/rpc-perf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/rpc-perf/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/rpc-perf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/rpc-perf/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/rpc-perf/languages","stargazers_url":"https://api.github.com/repos/twitter/rpc-perf/stargazers","contributors_url":"https://api.github.com/repos/twitter/rpc-perf/contributors","subscribers_url":"https://api.github.com/repos/twitter/rpc-perf/subscribers","subscription_url":"https://api.github.com/repos/twitter/rpc-perf/subscription","commits_url":"https://api.github.com/repos/twitter/rpc-perf/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/rpc-perf/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/rpc-perf/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/rpc-perf/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/rpc-perf/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/rpc-perf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/rpc-perf/merges","archive_url":"https://api.github.com/repos/twitter/rpc-perf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/rpc-perf/downloads","issues_url":"https://api.github.com/repos/twitter/rpc-perf/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/rpc-perf/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/rpc-perf/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/rpc-perf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/rpc-perf/labels{/name}","releases_url":"https://api.github.com/repos/twitter/rpc-perf/releases{/id}","deployments_url":"https://api.github.com/repos/twitter/rpc-perf/deployments","created_at":"2015-11-24T04:39:03Z","updated_at":"2018-07-24T18:53:16Z","pushed_at":"2018-07-24T06:43:22Z","git_url":"git://github.com/twitter/rpc-perf.git","ssh_url":"git@github.com:twitter/rpc-perf.git","clone_url":"https://github.com/twitter/rpc-perf.git","svn_url":"https://github.com/twitter/rpc-perf","homepage":null,"size":500,"stargazers_count":255,"watchers_count":255,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":9,"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":29,"open_issues":9,"watchers":255,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twitter/rpc-perf/pulls/153"},"html":{"href":"https://github.com/twitter/rpc-perf/pull/153"},"issue":{"href":"https://api.github.com/repos/twitter/rpc-perf/issues/153"},"comments":{"href":"https://api.github.com/repos/twitter/rpc-perf/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/twitter/rpc-perf/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/twitter/rpc-perf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twitter/rpc-perf/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/twitter/rpc-perf/statuses/bc68d81be0a5438c466849d805483bfd7ae65973"}},"author_association":"NONE"}}
{"actor":{"display_login":"slyphon"}}