{"action":"created","comment":{"url":"https://api.github.com/repos/apple/foundationdb/pulls/comments/286711320","pull_request_review_id":240881422,"id":286711320,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NjcxMTMyMA==","diff_hunk":"@@ -650,12 +650,63 @@ ACTOR Future<Void> fetchShardMetrics( DataDistributionTracker* self, GetMetricsR\n \treturn Void();\n }\n \n+\n+ACTOR Future<Void> fetchShardMetricsList_impl( DataDistributionTracker* self, GetMetricsListRequest req ) {\n+\ttry {\n+\t\tloop {\n+\t\t\t// no shard identifier as of yet, use simple numbering system\n+\t\t\t// also used to control shard limit\n+\t\t\tint shardNum = 1;\n+\t\t\t// list of metrics, regenerate on loop when full range unsuccessful\n+\t\t\tStandalone<RangeResultRef> result;\n+\t\t\tFuture<Void> onChange;\n+\t\t\tfor( auto t : self->shards.intersectingRanges( req.keys ) ) {\n+\t\t\t\tauto &stats = t.value().stats;\n+\t\t\t\tif( !stats->get().present() ) {\n+\t\t\t\t\tonChange = stats->onChange();\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t\tstd::string keyRanges = \"Begin: \" + t.begin().toString() + \", End: \" + t.end().toString();\n+\t\t\t\tresult.push_back_deep(\n+\t\t\t\t    result.arena(), KeyValueRef(KeyRef(std::to_string(shardNum)),\n+\t\t\t\t                                ValueRef(keyRanges + \", \" + t.value().stats->get().get().toString())));","path":"fdbserver/DataDistributionTracker.actor.cpp","position":23,"original_position":23,"commit_id":"74a705645b65254da8c2e40e9591dacecd23f0b0","original_commit_id":"74a705645b65254da8c2e40e9591dacecd23f0b0","user":{"login":"tclinken","id":7478013,"node_id":"MDQ6VXNlcjc0NzgwMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/7478013?v=4","gravatar_id":"","url":"https://api.github.com/users/tclinken","html_url":"https://github.com/tclinken","followers_url":"https://api.github.com/users/tclinken/followers","following_url":"https://api.github.com/users/tclinken/following{/other_user}","gists_url":"https://api.github.com/users/tclinken/gists{/gist_id}","starred_url":"https://api.github.com/users/tclinken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tclinken/subscriptions","organizations_url":"https://api.github.com/users/tclinken/orgs","repos_url":"https://api.github.com/users/tclinken/repos","events_url":"https://api.github.com/users/tclinken/events{/privacy}","received_events_url":"https://api.github.com/users/tclinken/received_events","type":"User","site_admin":false},"body":"We should reach a consensus amongst multiple people on what exactly the format or the keys and values should be (should we use JSON? A unique shard identifier as key? etc.) Once this issue is resolved and some other review comments are addressed, this PR can be upgraded to a non-draft PR.","created_at":"2019-05-22T22:23:14Z","updated_at":"2019-05-22T22:24:11Z","html_url":"https://github.com/apple/foundationdb/pull/1628#discussion_r286711320","pull_request_url":"https://api.github.com/repos/apple/foundationdb/pulls/1628","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/apple/foundationdb/pulls/comments/286711320"},"html":{"href":"https://github.com/apple/foundationdb/pull/1628#discussion_r286711320"},"pull_request":{"href":"https://api.github.com/repos/apple/foundationdb/pulls/1628"}}},"pull_request":{"url":"https://api.github.com/repos/apple/foundationdb/pulls/1628","id":281302996,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgxMzAyOTk2","html_url":"https://github.com/apple/foundationdb/pull/1628","diff_url":"https://github.com/apple/foundationdb/pull/1628.diff","patch_url":"https://github.com/apple/foundationdb/pull/1628.patch","issue_url":"https://api.github.com/repos/apple/foundationdb/issues/1628","number":1628,"state":"open","locked":false,"title":"Add data distribution metrics","user":{"login":"fzhjon","id":15724488,"node_id":"MDQ6VXNlcjE1NzI0NDg4","avatar_url":"https://avatars3.githubusercontent.com/u/15724488?v=4","gravatar_id":"","url":"https://api.github.com/users/fzhjon","html_url":"https://github.com/fzhjon","followers_url":"https://api.github.com/users/fzhjon/followers","following_url":"https://api.github.com/users/fzhjon/following{/other_user}","gists_url":"https://api.github.com/users/fzhjon/gists{/gist_id}","starred_url":"https://api.github.com/users/fzhjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fzhjon/subscriptions","organizations_url":"https://api.github.com/users/fzhjon/orgs","repos_url":"https://api.github.com/users/fzhjon/repos","events_url":"https://api.github.com/users/fzhjon/events{/privacy}","received_events_url":"https://api.github.com/users/fzhjon/received_events","type":"User","site_admin":false},"body":"The motivation of this change was to expose shard metrics to clients if they wanted to obtain those stats for any purposes. These changes add a new (special) key-range prefix which allow the client to request stats on all shards that intersect with a specified key-range. The stats are taken directly from the StorageMetrics struct already defined for use in DataDistributionTracker. Following the convention of other special keys, both begin and end range must be prefixed with \"\\xff\\xff/dd_stats/\", then followed by the begin/end keys the client wishes to use.\r\n\r\nAn example of this request run from fdbcli:\r\n```\r\nfdb> getrange \\xff\\xff/dd_stats/0 \\xff\\xff/dd_stats/z\r\n\r\nRange limited to 25 keys\r\n`1' is `Begin: , End: key/000127, Bytes: 307989, BPerKSec: 52000000, iosPerKSec: 200000'\r\n`2' is `Begin: key/000127, End: key/00027, Bytes: 335988, BPerKSec: 24000000, iosPerKSec: 100000'\r\n`3' is `Begin: key/00027, End: key/00038, Bytes: 279990, BPerKSec: 48000000, iosPerKSec: 200000'\r\n...\r\n```","created_at":"2019-05-22T18:06:40Z","updated_at":"2019-05-22T22:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d0045e485ee7ff017d01429de84754a0c201712","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apple/foundationdb/pulls/1628/commits","review_comments_url":"https://api.github.com/repos/apple/foundationdb/pulls/1628/comments","review_comment_url":"https://api.github.com/repos/apple/foundationdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/foundationdb/issues/1628/comments","statuses_url":"https://api.github.com/repos/apple/foundationdb/statuses/74a705645b65254da8c2e40e9591dacecd23f0b0","head":{"label":"fzhjon:add-data-distribution-metrics","ref":"add-data-distribution-metrics","sha":"74a705645b65254da8c2e40e9591dacecd23f0b0","user":{"login":"fzhjon","id":15724488,"node_id":"MDQ6VXNlcjE1NzI0NDg4","avatar_url":"https://avatars3.githubusercontent.com/u/15724488?v=4","gravatar_id":"","url":"https://api.github.com/users/fzhjon","html_url":"https://github.com/fzhjon","followers_url":"https://api.github.com/users/fzhjon/followers","following_url":"https://api.github.com/users/fzhjon/following{/other_user}","gists_url":"https://api.github.com/users/fzhjon/gists{/gist_id}","starred_url":"https://api.github.com/users/fzhjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fzhjon/subscriptions","organizations_url":"https://api.github.com/users/fzhjon/orgs","repos_url":"https://api.github.com/users/fzhjon/repos","events_url":"https://api.github.com/users/fzhjon/events{/privacy}","received_events_url":"https://api.github.com/users/fzhjon/received_events","type":"User","site_admin":false},"repo":{"id":187921031,"node_id":"MDEwOlJlcG9zaXRvcnkxODc5MjEwMzE=","name":"foundationdb","full_name":"fzhjon/foundationdb","private":false,"owner":{"login":"fzhjon","id":15724488,"node_id":"MDQ6VXNlcjE1NzI0NDg4","avatar_url":"https://avatars3.githubusercontent.com/u/15724488?v=4","gravatar_id":"","url":"https://api.github.com/users/fzhjon","html_url":"https://github.com/fzhjon","followers_url":"https://api.github.com/users/fzhjon/followers","following_url":"https://api.github.com/users/fzhjon/following{/other_user}","gists_url":"https://api.github.com/users/fzhjon/gists{/gist_id}","starred_url":"https://api.github.com/users/fzhjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fzhjon/subscriptions","organizations_url":"https://api.github.com/users/fzhjon/orgs","repos_url":"https://api.github.com/users/fzhjon/repos","events_url":"https://api.github.com/users/fzhjon/events{/privacy}","received_events_url":"https://api.github.com/users/fzhjon/received_events","type":"User","site_admin":false},"html_url":"https://github.com/fzhjon/foundationdb","description":"FoundationDB - the open source, distributed, transactional key-value store","fork":true,"url":"https://api.github.com/repos/fzhjon/foundationdb","forks_url":"https://api.github.com/repos/fzhjon/foundationdb/forks","keys_url":"https://api.github.com/repos/fzhjon/foundationdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fzhjon/foundationdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fzhjon/foundationdb/teams","hooks_url":"https://api.github.com/repos/fzhjon/foundationdb/hooks","issue_events_url":"https://api.github.com/repos/fzhjon/foundationdb/issues/events{/number}","events_url":"https://api.github.com/repos/fzhjon/foundationdb/events","assignees_url":"https://api.github.com/repos/fzhjon/foundationdb/assignees{/user}","branches_url":"https://api.github.com/repos/fzhjon/foundationdb/branches{/branch}","tags_url":"https://api.github.com/repos/fzhjon/foundationdb/tags","blobs_url":"https://api.github.com/repos/fzhjon/foundationdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fzhjon/foundationdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fzhjon/foundationdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/fzhjon/foundationdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fzhjon/foundationdb/statuses/{sha}","languages_url":"https://api.github.com/repos/fzhjon/foundationdb/languages","stargazers_url":"https://api.github.com/repos/fzhjon/foundationdb/stargazers","contributors_url":"https://api.github.com/repos/fzhjon/foundationdb/contributors","subscribers_url":"https://api.github.com/repos/fzhjon/foundationdb/subscribers","subscription_url":"https://api.github.com/repos/fzhjon/foundationdb/subscription","commits_url":"https://api.github.com/repos/fzhjon/foundationdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/fzhjon/foundationdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/fzhjon/foundationdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/fzhjon/foundationdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/fzhjon/foundationdb/contents/{+path}","compare_url":"https://api.github.com/repos/fzhjon/foundationdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fzhjon/foundationdb/merges","archive_url":"https://api.github.com/repos/fzhjon/foundationdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fzhjon/foundationdb/downloads","issues_url":"https://api.github.com/repos/fzhjon/foundationdb/issues{/number}","pulls_url":"https://api.github.com/repos/fzhjon/foundationdb/pulls{/number}","milestones_url":"https://api.github.com/repos/fzhjon/foundationdb/milestones{/number}","notifications_url":"https://api.github.com/repos/fzhjon/foundationdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fzhjon/foundationdb/labels{/name}","releases_url":"https://api.github.com/repos/fzhjon/foundationdb/releases{/id}","deployments_url":"https://api.github.com/repos/fzhjon/foundationdb/deployments","created_at":"2019-05-21T22:14:52Z","updated_at":"2019-05-21T22:14:59Z","pushed_at":"2019-05-22T19:45:24Z","git_url":"git://github.com/fzhjon/foundationdb.git","ssh_url":"git@github.com:fzhjon/foundationdb.git","clone_url":"https://github.com/fzhjon/foundationdb.git","svn_url":"https://github.com/fzhjon/foundationdb","homepage":"https://www.foundationdb.org","size":17792,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"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":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"c5fd42eb22cb2e9c19f13137b2774ddc81efd5d3","user":{"login":"apple","id":10639145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjM5MTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":114187903,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQxODc5MDM=","name":"foundationdb","full_name":"apple/foundationdb","private":false,"owner":{"login":"apple","id":10639145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjM5MTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apple/foundationdb","description":"FoundationDB - the open source, distributed, transactional key-value store","fork":false,"url":"https://api.github.com/repos/apple/foundationdb","forks_url":"https://api.github.com/repos/apple/foundationdb/forks","keys_url":"https://api.github.com/repos/apple/foundationdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/foundationdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/foundationdb/teams","hooks_url":"https://api.github.com/repos/apple/foundationdb/hooks","issue_events_url":"https://api.github.com/repos/apple/foundationdb/issues/events{/number}","events_url":"https://api.github.com/repos/apple/foundationdb/events","assignees_url":"https://api.github.com/repos/apple/foundationdb/assignees{/user}","branches_url":"https://api.github.com/repos/apple/foundationdb/branches{/branch}","tags_url":"https://api.github.com/repos/apple/foundationdb/tags","blobs_url":"https://api.github.com/repos/apple/foundationdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/foundationdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/foundationdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/foundationdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/foundationdb/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/foundationdb/languages","stargazers_url":"https://api.github.com/repos/apple/foundationdb/stargazers","contributors_url":"https://api.github.com/repos/apple/foundationdb/contributors","subscribers_url":"https://api.github.com/repos/apple/foundationdb/subscribers","subscription_url":"https://api.github.com/repos/apple/foundationdb/subscription","commits_url":"https://api.github.com/repos/apple/foundationdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/foundationdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/foundationdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/foundationdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/foundationdb/contents/{+path}","compare_url":"https://api.github.com/repos/apple/foundationdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/foundationdb/merges","archive_url":"https://api.github.com/repos/apple/foundationdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/foundationdb/downloads","issues_url":"https://api.github.com/repos/apple/foundationdb/issues{/number}","pulls_url":"https://api.github.com/repos/apple/foundationdb/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/foundationdb/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/foundationdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/foundationdb/labels{/name}","releases_url":"https://api.github.com/repos/apple/foundationdb/releases{/id}","deployments_url":"https://api.github.com/repos/apple/foundationdb/deployments","created_at":"2017-12-14T01:40:42Z","updated_at":"2019-05-22T16:54:07Z","pushed_at":"2019-05-22T22:06:25Z","git_url":"git://github.com/apple/foundationdb.git","ssh_url":"git@github.com:apple/foundationdb.git","clone_url":"https://github.com/apple/foundationdb.git","svn_url":"https://github.com/apple/foundationdb","homepage":"https://www.foundationdb.org","size":17783,"stargazers_count":9266,"watchers_count":9266,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":723,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":258,"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":723,"open_issues":258,"watchers":9266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/foundationdb/pulls/1628"},"html":{"href":"https://github.com/apple/foundationdb/pull/1628"},"issue":{"href":"https://api.github.com/repos/apple/foundationdb/issues/1628"},"comments":{"href":"https://api.github.com/repos/apple/foundationdb/issues/1628/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/foundationdb/pulls/1628/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/foundationdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/foundationdb/pulls/1628/commits"},"statuses":{"href":"https://api.github.com/repos/apple/foundationdb/statuses/74a705645b65254da8c2e40e9591dacecd23f0b0"}},"author_association":"NONE"}}
{"actor":{"display_login":"tclinken"}}