{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/pd/pulls/comments/177312981","pull_request_review_id":107157860,"id":177312981,"diff_hunk":"@@ -0,0 +1,156 @@\n+// Copyright 2018 PingCAP, Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package api\n+\n+import (\n+\t\"context\"\n+\t\"github.com/juju/errors\"\n+\t\"github.com/pingcap/kvproto/pkg/pdpb\"\n+\t\"github.com/pingcap/pd/server\"\n+\t\"github.com/unrolled/render\"\n+\t\"net/http\"\n+\t\"time\"\n+)\n+\n+type diagnoseType int\n+type diagnoseKV map[diagnoseType]Recommended\n+\n+//Recommended return detail\n+type Recommended struct {\n+\tModule      string `json:\"module\"`\n+\tLevel       string `json:\"level\"`\n+\tDescription string `json:\"description\"`\n+\tInstruction string `json:\"instruction\"`\n+}\n+\n+const (\n+\t//analyze level","path":"server/api/diagnose.go","position":38,"original_position":38,"commit_id":"6cda6988702724fb31b4e7c85fa401ca97995e2d","original_commit_id":"6cda6988702724fb31b4e7c85fa401ca97995e2d","user":{"login":"disksing","id":12077877,"avatar_url":"https://avatars1.githubusercontent.com/u/12077877?v=4","gravatar_id":"","url":"https://api.github.com/users/disksing","html_url":"https://github.com/disksing","followers_url":"https://api.github.com/users/disksing/followers","following_url":"https://api.github.com/users/disksing/following{/other_user}","gists_url":"https://api.github.com/users/disksing/gists{/gist_id}","starred_url":"https://api.github.com/users/disksing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/disksing/subscriptions","organizations_url":"https://api.github.com/users/disksing/orgs","repos_url":"https://api.github.com/users/disksing/repos","events_url":"https://api.github.com/users/disksing/events{/privacy}","received_events_url":"https://api.github.com/users/disksing/received_events","type":"User","site_admin":false},"body":"Add a space between `//` and the comment after it.","created_at":"2018-03-27T05:42:14Z","updated_at":"2018-03-27T05:54:44Z","html_url":"https://github.com/pingcap/pd/pull/1004#discussion_r177312981","pull_request_url":"https://api.github.com/repos/pingcap/pd/pulls/1004","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pingcap/pd/pulls/comments/177312981"},"html":{"href":"https://github.com/pingcap/pd/pull/1004#discussion_r177312981"},"pull_request":{"href":"https://api.github.com/repos/pingcap/pd/pulls/1004"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/pd/pulls/1004","id":177347750,"html_url":"https://github.com/pingcap/pd/pull/1004","diff_url":"https://github.com/pingcap/pd/pull/1004.diff","patch_url":"https://github.com/pingcap/pd/pull/1004.patch","issue_url":"https://api.github.com/repos/pingcap/pd/issues/1004","number":1004,"state":"open","locked":false,"title":"api: add diagnose api","user":{"login":"jomenxiao","id":4003391,"avatar_url":"https://avatars3.githubusercontent.com/u/4003391?v=4","gravatar_id":"","url":"https://api.github.com/users/jomenxiao","html_url":"https://github.com/jomenxiao","followers_url":"https://api.github.com/users/jomenxiao/followers","following_url":"https://api.github.com/users/jomenxiao/following{/other_user}","gists_url":"https://api.github.com/users/jomenxiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jomenxiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomenxiao/subscriptions","organizations_url":"https://api.github.com/users/jomenxiao/orgs","repos_url":"https://api.github.com/users/jomenxiao/repos","events_url":"https://api.github.com/users/jomenxiao/events{/privacy}","received_events_url":"https://api.github.com/users/jomenxiao/received_events","type":"User","site_admin":false},"body":"diagnose PD and give some advice for the maintainer","created_at":"2018-03-26T05:48:07Z","updated_at":"2018-03-27T05:54:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e36226528138f828e5b33369490eb3d68f611b76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/pd/pulls/1004/commits","review_comments_url":"https://api.github.com/repos/pingcap/pd/pulls/1004/comments","review_comment_url":"https://api.github.com/repos/pingcap/pd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/pd/issues/1004/comments","statuses_url":"https://api.github.com/repos/pingcap/pd/statuses/6cda6988702724fb31b4e7c85fa401ca97995e2d","head":{"label":"jomenxiao:jomenxiao/add_stats","ref":"jomenxiao/add_stats","sha":"6cda6988702724fb31b4e7c85fa401ca97995e2d","user":{"login":"jomenxiao","id":4003391,"avatar_url":"https://avatars3.githubusercontent.com/u/4003391?v=4","gravatar_id":"","url":"https://api.github.com/users/jomenxiao","html_url":"https://github.com/jomenxiao","followers_url":"https://api.github.com/users/jomenxiao/followers","following_url":"https://api.github.com/users/jomenxiao/following{/other_user}","gists_url":"https://api.github.com/users/jomenxiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jomenxiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomenxiao/subscriptions","organizations_url":"https://api.github.com/users/jomenxiao/orgs","repos_url":"https://api.github.com/users/jomenxiao/repos","events_url":"https://api.github.com/users/jomenxiao/events{/privacy}","received_events_url":"https://api.github.com/users/jomenxiao/received_events","type":"User","site_admin":false},"repo":{"id":119495353,"name":"pd","full_name":"jomenxiao/pd","owner":{"login":"jomenxiao","id":4003391,"avatar_url":"https://avatars3.githubusercontent.com/u/4003391?v=4","gravatar_id":"","url":"https://api.github.com/users/jomenxiao","html_url":"https://github.com/jomenxiao","followers_url":"https://api.github.com/users/jomenxiao/followers","following_url":"https://api.github.com/users/jomenxiao/following{/other_user}","gists_url":"https://api.github.com/users/jomenxiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jomenxiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomenxiao/subscriptions","organizations_url":"https://api.github.com/users/jomenxiao/orgs","repos_url":"https://api.github.com/users/jomenxiao/repos","events_url":"https://api.github.com/users/jomenxiao/events{/privacy}","received_events_url":"https://api.github.com/users/jomenxiao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jomenxiao/pd","description":"Placement driver for TiKV","fork":true,"url":"https://api.github.com/repos/jomenxiao/pd","forks_url":"https://api.github.com/repos/jomenxiao/pd/forks","keys_url":"https://api.github.com/repos/jomenxiao/pd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jomenxiao/pd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jomenxiao/pd/teams","hooks_url":"https://api.github.com/repos/jomenxiao/pd/hooks","issue_events_url":"https://api.github.com/repos/jomenxiao/pd/issues/events{/number}","events_url":"https://api.github.com/repos/jomenxiao/pd/events","assignees_url":"https://api.github.com/repos/jomenxiao/pd/assignees{/user}","branches_url":"https://api.github.com/repos/jomenxiao/pd/branches{/branch}","tags_url":"https://api.github.com/repos/jomenxiao/pd/tags","blobs_url":"https://api.github.com/repos/jomenxiao/pd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jomenxiao/pd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jomenxiao/pd/git/refs{/sha}","trees_url":"https://api.github.com/repos/jomenxiao/pd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jomenxiao/pd/statuses/{sha}","languages_url":"https://api.github.com/repos/jomenxiao/pd/languages","stargazers_url":"https://api.github.com/repos/jomenxiao/pd/stargazers","contributors_url":"https://api.github.com/repos/jomenxiao/pd/contributors","subscribers_url":"https://api.github.com/repos/jomenxiao/pd/subscribers","subscription_url":"https://api.github.com/repos/jomenxiao/pd/subscription","commits_url":"https://api.github.com/repos/jomenxiao/pd/commits{/sha}","git_commits_url":"https://api.github.com/repos/jomenxiao/pd/git/commits{/sha}","comments_url":"https://api.github.com/repos/jomenxiao/pd/comments{/number}","issue_comment_url":"https://api.github.com/repos/jomenxiao/pd/issues/comments{/number}","contents_url":"https://api.github.com/repos/jomenxiao/pd/contents/{+path}","compare_url":"https://api.github.com/repos/jomenxiao/pd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jomenxiao/pd/merges","archive_url":"https://api.github.com/repos/jomenxiao/pd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jomenxiao/pd/downloads","issues_url":"https://api.github.com/repos/jomenxiao/pd/issues{/number}","pulls_url":"https://api.github.com/repos/jomenxiao/pd/pulls{/number}","milestones_url":"https://api.github.com/repos/jomenxiao/pd/milestones{/number}","notifications_url":"https://api.github.com/repos/jomenxiao/pd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jomenxiao/pd/labels{/name}","releases_url":"https://api.github.com/repos/jomenxiao/pd/releases{/id}","deployments_url":"https://api.github.com/repos/jomenxiao/pd/deployments","created_at":"2018-01-30T06:54:05Z","updated_at":"2018-03-26T05:30:31Z","pushed_at":"2018-03-27T04:29:54Z","git_url":"git://github.com/jomenxiao/pd.git","ssh_url":"git@github.com:jomenxiao/pd.git","clone_url":"https://github.com/jomenxiao/pd.git","svn_url":"https://github.com/jomenxiao/pd","homepage":"","size":10265,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"868cb2bb45f31a99026fa28fe8f2b44e9dcd67b2","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":53311716,"name":"pd","full_name":"pingcap/pd","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/pd","description":"Placement driver for TiKV","fork":false,"url":"https://api.github.com/repos/pingcap/pd","forks_url":"https://api.github.com/repos/pingcap/pd/forks","keys_url":"https://api.github.com/repos/pingcap/pd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/pd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/pd/teams","hooks_url":"https://api.github.com/repos/pingcap/pd/hooks","issue_events_url":"https://api.github.com/repos/pingcap/pd/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/pd/events","assignees_url":"https://api.github.com/repos/pingcap/pd/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/pd/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/pd/tags","blobs_url":"https://api.github.com/repos/pingcap/pd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/pd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/pd/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/pd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/pd/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/pd/languages","stargazers_url":"https://api.github.com/repos/pingcap/pd/stargazers","contributors_url":"https://api.github.com/repos/pingcap/pd/contributors","subscribers_url":"https://api.github.com/repos/pingcap/pd/subscribers","subscription_url":"https://api.github.com/repos/pingcap/pd/subscription","commits_url":"https://api.github.com/repos/pingcap/pd/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/pd/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/pd/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/pd/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/pd/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/pd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/pd/merges","archive_url":"https://api.github.com/repos/pingcap/pd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/pd/downloads","issues_url":"https://api.github.com/repos/pingcap/pd/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/pd/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/pd/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/pd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/pd/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/pd/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/pd/deployments","created_at":"2016-03-07T09:13:06Z","updated_at":"2018-03-27T05:51:30Z","pushed_at":"2018-03-27T05:52:28Z","git_url":"git://github.com/pingcap/pd.git","ssh_url":"git@github.com:pingcap/pd.git","clone_url":"https://github.com/pingcap/pd.git","svn_url":"https://github.com/pingcap/pd","homepage":"","size":10348,"stargazers_count":179,"watchers_count":179,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":103,"open_issues":41,"watchers":179,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/pd/pulls/1004"},"html":{"href":"https://github.com/pingcap/pd/pull/1004"},"issue":{"href":"https://api.github.com/repos/pingcap/pd/issues/1004"},"comments":{"href":"https://api.github.com/repos/pingcap/pd/issues/1004/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/pd/pulls/1004/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/pd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/pd/pulls/1004/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/pd/statuses/6cda6988702724fb31b4e7c85fa401ca97995e2d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"disksing"}}