{"action":"created","comment":{"url":"https://api.github.com/repos/XiaoMi/pegasus/pulls/comments/232581218","pull_request_review_id":173802242,"id":232581218,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjU4MTIxOA==","diff_hunk":"@@ -315,14 +324,44 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)\n                                                 \"statistic the recent abnormal read count\");\n \n     snprintf(buf, 255, \"disk.storage.sst.count@%s\", str_gpid);\n-    _pfc_sst_count.init_app_counter(\n+    _pfc_rdb_sst_count.init_app_counter(\n         \"app.pegasus\", buf, COUNTER_TYPE_NUMBER, \"statistic the count of sstable files\");\n \n     snprintf(buf, 255, \"disk.storage.sst(MB)@%s\", str_gpid);\n-    _pfc_sst_size.init_app_counter(\n+    _pfc_rdb_sst_size.init_app_counter(\n         \"app.pegasus\", buf, COUNTER_TYPE_NUMBER, \"statistic the size of sstable files\");\n \n-    updating_rocksdb_sstsize();\n+    snprintf(buf, 255, \"rdb.block_cache.hit_count@%s\", str_gpid);\n+    _pfc_rdb_block_cache_hit_count.init_app_counter(\n+        \"app.pegasus\", buf, COUNTER_TYPE_NUMBER, \"statistic the hit count of rocksdb block cache\");\n+\n+    snprintf(buf, 255, \"rdb.block_cache.total_count@%s\", str_gpid);\n+    _pfc_rdb_block_cache_total_count.init_app_counter(\n+        \"app.pegasus\",\n+        buf,\n+        COUNTER_TYPE_NUMBER,\n+        \"statistic the total count of rocksdb block cache\");\n+\n+    static std::once_flag flag;\n+    std::call_once(flag, [&]() {","path":"src/server/pegasus_server_impl.cpp","position":131,"original_position":131,"commit_id":"14a4a3e10791b490cb0c34c83381e7ebe4f73afe","original_commit_id":"14a4a3e10791b490cb0c34c83381e7ebe4f73afe","user":{"login":"qinzuoyan","id":528445,"node_id":"MDQ6VXNlcjUyODQ0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/528445?v=4","gravatar_id":"","url":"https://api.github.com/users/qinzuoyan","html_url":"https://github.com/qinzuoyan","followers_url":"https://api.github.com/users/qinzuoyan/followers","following_url":"https://api.github.com/users/qinzuoyan/following{/other_user}","gists_url":"https://api.github.com/users/qinzuoyan/gists{/gist_id}","starred_url":"https://api.github.com/users/qinzuoyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qinzuoyan/subscriptions","organizations_url":"https://api.github.com/users/qinzuoyan/orgs","repos_url":"https://api.github.com/users/qinzuoyan/repos","events_url":"https://api.github.com/users/qinzuoyan/events{/privacy}","received_events_url":"https://api.github.com/users/qinzuoyan/received_events","type":"User","site_admin":false},"body":"增加注释，说明为什么用call_once。","created_at":"2018-11-12T09:19:55Z","updated_at":"2018-11-12T09:23:12Z","html_url":"https://github.com/XiaoMi/pegasus/pull/212#discussion_r232581218","pull_request_url":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/XiaoMi/pegasus/pulls/comments/232581218"},"html":{"href":"https://github.com/XiaoMi/pegasus/pull/212#discussion_r232581218"},"pull_request":{"href":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212"}}},"pull_request":{"url":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212","id":229644576,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NjQ0NTc2","html_url":"https://github.com/XiaoMi/pegasus/pull/212","diff_url":"https://github.com/XiaoMi/pegasus/pull/212.diff","patch_url":"https://github.com/XiaoMi/pegasus/pull/212.patch","issue_url":"https://api.github.com/repos/XiaoMi/pegasus/issues/212","number":212,"state":"open","locked":false,"title":"monitor: expose rocksdb statistics to pegasus","user":{"login":"acelyc111","id":10775040,"node_id":"MDQ6VXNlcjEwNzc1MDQw","avatar_url":"https://avatars1.githubusercontent.com/u/10775040?v=4","gravatar_id":"","url":"https://api.github.com/users/acelyc111","html_url":"https://github.com/acelyc111","followers_url":"https://api.github.com/users/acelyc111/followers","following_url":"https://api.github.com/users/acelyc111/following{/other_user}","gists_url":"https://api.github.com/users/acelyc111/gists{/gist_id}","starred_url":"https://api.github.com/users/acelyc111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acelyc111/subscriptions","organizations_url":"https://api.github.com/users/acelyc111/orgs","repos_url":"https://api.github.com/users/acelyc111/repos","events_url":"https://api.github.com/users/acelyc111/events{/privacy}","received_events_url":"https://api.github.com/users/acelyc111/received_events","type":"User","site_admin":false},"body":"https://github.com/XiaoMi/pegasus/issues/184","created_at":"2018-11-09T10:08:45Z","updated_at":"2018-11-12T09:23:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b403710961df8e943eb6f19bedca332c3121527b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1121726764,"node_id":"MDU6TGFiZWwxMTIxNzI2NzY0","url":"https://api.github.com/repos/XiaoMi/pegasus/labels/component/monitor","name":"component/monitor","color":"49d84e","default":false},{"id":958524996,"node_id":"MDU6TGFiZWw5NTg1MjQ5OTY=","url":"https://api.github.com/repos/XiaoMi/pegasus/labels/submodule/rocksdb","name":"submodule/rocksdb","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212/commits","review_comments_url":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212/comments","review_comment_url":"https://api.github.com/repos/XiaoMi/pegasus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/XiaoMi/pegasus/issues/212/comments","statuses_url":"https://api.github.com/repos/XiaoMi/pegasus/statuses/14a4a3e10791b490cb0c34c83381e7ebe4f73afe","head":{"label":"acelyc111:rocksdb_metrics","ref":"rocksdb_metrics","sha":"14a4a3e10791b490cb0c34c83381e7ebe4f73afe","user":{"login":"acelyc111","id":10775040,"node_id":"MDQ6VXNlcjEwNzc1MDQw","avatar_url":"https://avatars1.githubusercontent.com/u/10775040?v=4","gravatar_id":"","url":"https://api.github.com/users/acelyc111","html_url":"https://github.com/acelyc111","followers_url":"https://api.github.com/users/acelyc111/followers","following_url":"https://api.github.com/users/acelyc111/following{/other_user}","gists_url":"https://api.github.com/users/acelyc111/gists{/gist_id}","starred_url":"https://api.github.com/users/acelyc111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acelyc111/subscriptions","organizations_url":"https://api.github.com/users/acelyc111/orgs","repos_url":"https://api.github.com/users/acelyc111/repos","events_url":"https://api.github.com/users/acelyc111/events{/privacy}","received_events_url":"https://api.github.com/users/acelyc111/received_events","type":"User","site_admin":false},"repo":{"id":111100635,"node_id":"MDEwOlJlcG9zaXRvcnkxMTExMDA2MzU=","name":"pegasus","full_name":"acelyc111/pegasus","private":false,"owner":{"login":"acelyc111","id":10775040,"node_id":"MDQ6VXNlcjEwNzc1MDQw","avatar_url":"https://avatars1.githubusercontent.com/u/10775040?v=4","gravatar_id":"","url":"https://api.github.com/users/acelyc111","html_url":"https://github.com/acelyc111","followers_url":"https://api.github.com/users/acelyc111/followers","following_url":"https://api.github.com/users/acelyc111/following{/other_user}","gists_url":"https://api.github.com/users/acelyc111/gists{/gist_id}","starred_url":"https://api.github.com/users/acelyc111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acelyc111/subscriptions","organizations_url":"https://api.github.com/users/acelyc111/orgs","repos_url":"https://api.github.com/users/acelyc111/repos","events_url":"https://api.github.com/users/acelyc111/events{/privacy}","received_events_url":"https://api.github.com/users/acelyc111/received_events","type":"User","site_admin":false},"html_url":"https://github.com/acelyc111/pegasus","description":null,"fork":true,"url":"https://api.github.com/repos/acelyc111/pegasus","forks_url":"https://api.github.com/repos/acelyc111/pegasus/forks","keys_url":"https://api.github.com/repos/acelyc111/pegasus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acelyc111/pegasus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acelyc111/pegasus/teams","hooks_url":"https://api.github.com/repos/acelyc111/pegasus/hooks","issue_events_url":"https://api.github.com/repos/acelyc111/pegasus/issues/events{/number}","events_url":"https://api.github.com/repos/acelyc111/pegasus/events","assignees_url":"https://api.github.com/repos/acelyc111/pegasus/assignees{/user}","branches_url":"https://api.github.com/repos/acelyc111/pegasus/branches{/branch}","tags_url":"https://api.github.com/repos/acelyc111/pegasus/tags","blobs_url":"https://api.github.com/repos/acelyc111/pegasus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acelyc111/pegasus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acelyc111/pegasus/git/refs{/sha}","trees_url":"https://api.github.com/repos/acelyc111/pegasus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acelyc111/pegasus/statuses/{sha}","languages_url":"https://api.github.com/repos/acelyc111/pegasus/languages","stargazers_url":"https://api.github.com/repos/acelyc111/pegasus/stargazers","contributors_url":"https://api.github.com/repos/acelyc111/pegasus/contributors","subscribers_url":"https://api.github.com/repos/acelyc111/pegasus/subscribers","subscription_url":"https://api.github.com/repos/acelyc111/pegasus/subscription","commits_url":"https://api.github.com/repos/acelyc111/pegasus/commits{/sha}","git_commits_url":"https://api.github.com/repos/acelyc111/pegasus/git/commits{/sha}","comments_url":"https://api.github.com/repos/acelyc111/pegasus/comments{/number}","issue_comment_url":"https://api.github.com/repos/acelyc111/pegasus/issues/comments{/number}","contents_url":"https://api.github.com/repos/acelyc111/pegasus/contents/{+path}","compare_url":"https://api.github.com/repos/acelyc111/pegasus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acelyc111/pegasus/merges","archive_url":"https://api.github.com/repos/acelyc111/pegasus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acelyc111/pegasus/downloads","issues_url":"https://api.github.com/repos/acelyc111/pegasus/issues{/number}","pulls_url":"https://api.github.com/repos/acelyc111/pegasus/pulls{/number}","milestones_url":"https://api.github.com/repos/acelyc111/pegasus/milestones{/number}","notifications_url":"https://api.github.com/repos/acelyc111/pegasus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acelyc111/pegasus/labels{/name}","releases_url":"https://api.github.com/repos/acelyc111/pegasus/releases{/id}","deployments_url":"https://api.github.com/repos/acelyc111/pegasus/deployments","created_at":"2017-11-17T12:22:52Z","updated_at":"2018-11-05T07:02:07Z","pushed_at":"2018-11-12T07:40:29Z","git_url":"git://github.com/acelyc111/pegasus.git","ssh_url":"git@github.com:acelyc111/pegasus.git","clone_url":"https://github.com/acelyc111/pegasus.git","svn_url":"https://github.com/acelyc111/pegasus","homepage":null,"size":29566,"stargazers_count":0,"watchers_count":0,"language":"C++","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":1,"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":1,"watchers":0,"default_branch":"master"}},"base":{"label":"XiaoMi:master","ref":"master","sha":"7ba3b707b873366b9c5dd5f83be79564a9a6951e","user":{"login":"XiaoMi","id":1309360,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDkzNjA=","avatar_url":"https://avatars3.githubusercontent.com/u/1309360?v=4","gravatar_id":"","url":"https://api.github.com/users/XiaoMi","html_url":"https://github.com/XiaoMi","followers_url":"https://api.github.com/users/XiaoMi/followers","following_url":"https://api.github.com/users/XiaoMi/following{/other_user}","gists_url":"https://api.github.com/users/XiaoMi/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaoMi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaoMi/subscriptions","organizations_url":"https://api.github.com/users/XiaoMi/orgs","repos_url":"https://api.github.com/users/XiaoMi/repos","events_url":"https://api.github.com/users/XiaoMi/events{/privacy}","received_events_url":"https://api.github.com/users/XiaoMi/received_events","type":"Organization","site_admin":false},"repo":{"id":41712332,"node_id":"MDEwOlJlcG9zaXRvcnk0MTcxMjMzMg==","name":"pegasus","full_name":"XiaoMi/pegasus","private":false,"owner":{"login":"XiaoMi","id":1309360,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDkzNjA=","avatar_url":"https://avatars3.githubusercontent.com/u/1309360?v=4","gravatar_id":"","url":"https://api.github.com/users/XiaoMi","html_url":"https://github.com/XiaoMi","followers_url":"https://api.github.com/users/XiaoMi/followers","following_url":"https://api.github.com/users/XiaoMi/following{/other_user}","gists_url":"https://api.github.com/users/XiaoMi/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaoMi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaoMi/subscriptions","organizations_url":"https://api.github.com/users/XiaoMi/orgs","repos_url":"https://api.github.com/users/XiaoMi/repos","events_url":"https://api.github.com/users/XiaoMi/events{/privacy}","received_events_url":"https://api.github.com/users/XiaoMi/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/XiaoMi/pegasus","description":"A distributed key-value storage system developed and maintained by Xiaomi Cloud Storage Team.","fork":false,"url":"https://api.github.com/repos/XiaoMi/pegasus","forks_url":"https://api.github.com/repos/XiaoMi/pegasus/forks","keys_url":"https://api.github.com/repos/XiaoMi/pegasus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XiaoMi/pegasus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XiaoMi/pegasus/teams","hooks_url":"https://api.github.com/repos/XiaoMi/pegasus/hooks","issue_events_url":"https://api.github.com/repos/XiaoMi/pegasus/issues/events{/number}","events_url":"https://api.github.com/repos/XiaoMi/pegasus/events","assignees_url":"https://api.github.com/repos/XiaoMi/pegasus/assignees{/user}","branches_url":"https://api.github.com/repos/XiaoMi/pegasus/branches{/branch}","tags_url":"https://api.github.com/repos/XiaoMi/pegasus/tags","blobs_url":"https://api.github.com/repos/XiaoMi/pegasus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XiaoMi/pegasus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XiaoMi/pegasus/git/refs{/sha}","trees_url":"https://api.github.com/repos/XiaoMi/pegasus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XiaoMi/pegasus/statuses/{sha}","languages_url":"https://api.github.com/repos/XiaoMi/pegasus/languages","stargazers_url":"https://api.github.com/repos/XiaoMi/pegasus/stargazers","contributors_url":"https://api.github.com/repos/XiaoMi/pegasus/contributors","subscribers_url":"https://api.github.com/repos/XiaoMi/pegasus/subscribers","subscription_url":"https://api.github.com/repos/XiaoMi/pegasus/subscription","commits_url":"https://api.github.com/repos/XiaoMi/pegasus/commits{/sha}","git_commits_url":"https://api.github.com/repos/XiaoMi/pegasus/git/commits{/sha}","comments_url":"https://api.github.com/repos/XiaoMi/pegasus/comments{/number}","issue_comment_url":"https://api.github.com/repos/XiaoMi/pegasus/issues/comments{/number}","contents_url":"https://api.github.com/repos/XiaoMi/pegasus/contents/{+path}","compare_url":"https://api.github.com/repos/XiaoMi/pegasus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XiaoMi/pegasus/merges","archive_url":"https://api.github.com/repos/XiaoMi/pegasus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XiaoMi/pegasus/downloads","issues_url":"https://api.github.com/repos/XiaoMi/pegasus/issues{/number}","pulls_url":"https://api.github.com/repos/XiaoMi/pegasus/pulls{/number}","milestones_url":"https://api.github.com/repos/XiaoMi/pegasus/milestones{/number}","notifications_url":"https://api.github.com/repos/XiaoMi/pegasus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XiaoMi/pegasus/labels{/name}","releases_url":"https://api.github.com/repos/XiaoMi/pegasus/releases{/id}","deployments_url":"https://api.github.com/repos/XiaoMi/pegasus/deployments","created_at":"2015-09-01T02:29:37Z","updated_at":"2018-11-11T15:38:06Z","pushed_at":"2018-11-09T13:29:37Z","git_url":"git://github.com/XiaoMi/pegasus.git","ssh_url":"git@github.com:XiaoMi/pegasus.git","clone_url":"https://github.com/XiaoMi/pegasus.git","svn_url":"https://github.com/XiaoMi/pegasus","homepage":"","size":29176,"stargazers_count":835,"watchers_count":835,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":140,"mirror_url":null,"archived":false,"open_issues_count":38,"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":140,"open_issues":38,"watchers":835,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212"},"html":{"href":"https://github.com/XiaoMi/pegasus/pull/212"},"issue":{"href":"https://api.github.com/repos/XiaoMi/pegasus/issues/212"},"comments":{"href":"https://api.github.com/repos/XiaoMi/pegasus/issues/212/comments"},"review_comments":{"href":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212/comments"},"review_comment":{"href":"https://api.github.com/repos/XiaoMi/pegasus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/XiaoMi/pegasus/pulls/212/commits"},"statuses":{"href":"https://api.github.com/repos/XiaoMi/pegasus/statuses/14a4a3e10791b490cb0c34c83381e7ebe4f73afe"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"qinzuoyan"}}