{"action":"created","comment":{"url":"https://api.github.com/repos/minio/minio/pulls/comments/245316602","pull_request_review_id":189375442,"id":245316602,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTMxNjYwMg==","diff_hunk":"@@ -198,9 +200,47 @@ func (endpoints EndpointList) GetString(i int) string {\n \treturn endpoints[i].String()\n }\n \n-// localEndpointsPerf - returns ServerDrivesPerfInfo for only the\n+// localEndpointsMemStat - returns ServerMemStatInfo for only the\n // local endpoints from given list of endpoints\n-func localEndpointsPerf(endpoints EndpointList) ServerDrivesPerfInfo {\n+func localEndpointsMemStat(endpoints EndpointList) ServerMemStatInfo {\n+\tvar memStats []mem.Stats\n+\tvar addr string\n+\tfor _, endpoint := range endpoints {","path":"cmd/endpoint.go","position":21,"original_position":21,"commit_id":"46986f71ccba528cf70a544e9af57c05c6f1b648","original_commit_id":"46986f71ccba528cf70a544e9af57c05c6f1b648","user":{"login":"nitisht","id":5156139,"node_id":"MDQ6VXNlcjUxNTYxMzk=","avatar_url":"https://avatars0.githubusercontent.com/u/5156139?v=4","gravatar_id":"","url":"https://api.github.com/users/nitisht","html_url":"https://github.com/nitisht","followers_url":"https://api.github.com/users/nitisht/followers","following_url":"https://api.github.com/users/nitisht/following{/other_user}","gists_url":"https://api.github.com/users/nitisht/gists{/gist_id}","starred_url":"https://api.github.com/users/nitisht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitisht/subscriptions","organizations_url":"https://api.github.com/users/nitisht/orgs","repos_url":"https://api.github.com/users/nitisht/repos","events_url":"https://api.github.com/users/nitisht/events{/privacy}","received_events_url":"https://api.github.com/users/nitisht/received_events","type":"User","site_admin":false},"body":"Drives correspond to exact number of `endpoints` - CPU / Mem only correspond to exact number of unique nodes in the deployment. For example, \r\n\r\nA 2 node, 4 drive deployment like this \r\n\r\n```\r\n./minio server http://host1/disk1 http://host1/disk2 http://host2/disk1 http://host2/disk2\r\n```\r\n\r\nwill report Mem info like this \r\n\r\n```json\r\n[{\r\n\t\"addr\": \"host1\",\r\n\t\"perf\": [{\r\n\t\t\"mem\": \"32.81M\"\r\n\t}, {\r\n\t\t\"mem\": \"32.81M\"\r\n\t}]\r\n}, {\r\n\t\"addr\": \"host2\",\r\n\t\"perf\": [{\r\n\t\t\"mem\": \"28.68M\"\r\n\t}, {\r\n\t\t\"mem\": \"28.68M\"\r\n\t}]\r\n}]\r\n```\r\n\r\nIt should report it like \r\n\r\n```\r\n[{\r\n\t\"addr\": \"host1\",\r\n\t\"perf\": [{\r\n\t\t\"mem\": \"32.81M\"\r\n\t}]\r\n}, {\r\n\t\"addr\": \"host2\",\r\n\t\"perf\": [{\r\n\t\t\"mem\": \"28.68M\"\r\n\t}]\r\n}]\r\n```","created_at":"2019-01-04T14:46:25Z","updated_at":"2019-01-04T14:47:57Z","html_url":"https://github.com/minio/minio/pull/7038#discussion_r245316602","pull_request_url":"https://api.github.com/repos/minio/minio/pulls/7038","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/minio/minio/pulls/comments/245316602"},"html":{"href":"https://github.com/minio/minio/pull/7038#discussion_r245316602"},"pull_request":{"href":"https://api.github.com/repos/minio/minio/pulls/7038"}}},"pull_request":{"url":"https://api.github.com/repos/minio/minio/pulls/7038","id":241875392,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxODc1Mzky","html_url":"https://github.com/minio/minio/pull/7038","diff_url":"https://github.com/minio/minio/pull/7038.diff","patch_url":"https://github.com/minio/minio/pull/7038.patch","issue_url":"https://api.github.com/repos/minio/minio/issues/7038","number":7038,"state":"open","locked":false,"title":"Add ServerCPUPerfInfo() and ServerMemPerfInfo() admin API","user":{"login":"wlan0","id":1050521,"node_id":"MDQ6VXNlcjEwNTA1MjE=","avatar_url":"https://avatars0.githubusercontent.com/u/1050521?v=4","gravatar_id":"","url":"https://api.github.com/users/wlan0","html_url":"https://github.com/wlan0","followers_url":"https://api.github.com/users/wlan0/followers","following_url":"https://api.github.com/users/wlan0/following{/other_user}","gists_url":"https://api.github.com/users/wlan0/gists{/gist_id}","starred_url":"https://api.github.com/users/wlan0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlan0/subscriptions","organizations_url":"https://api.github.com/users/wlan0/orgs","repos_url":"https://api.github.com/users/wlan0/repos","events_url":"https://api.github.com/users/wlan0/events{/privacy}","received_events_url":"https://api.github.com/users/wlan0/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\nThis is a part of implementation of mc admin health command.\r\nServerCPUPerfInfo() exposes local and remote cpu utilization percentage.\r\nServerMemPerfInfo() exposes local and remote memory utilization.\r\n\r\n## Motivation and Context\r\nPart of https://github.com/minio/mc/issues/2606\r\n\r\n## Regression\r\nNo\r\n\r\n## How Has This Been Tested?\r\nUsing the madmin package\r\n\r\n```bash\r\n# start minio server\r\n$$ ./minio server /tmp/minio\r\n# madmin client query\r\n$$ cat > test.go << EOF\r\npackage main\r\n\r\nimport (\r\n        \"github.com/minio/minio/pkg/madmin\"\r\n        \"log\"\r\n)\r\n\r\nfunc main() {\r\n        client, err := madmin.New(\"127.0.0.1:9000\", \"minio\", \"minio123\", false)\r\n        if err != nil {\r\n                log.Fatalf(\"error connecting to minio123 server: %v\", err)\r\n        }\r\n\r\n        cpuPerfs, err := client.ServerCPUPerfInfo()\r\n        if err != nil {\r\n                log.Fatalf(\"error obtaining cpu perf: %v\", err)\r\n        }\r\n        for _, perf := range cpuPerfs {\r\n                log.Printf(\"%s's cpu utilization avg: %s min: %s max: %s\\n\", perf.Addr, perf.Perf[0].Avg, perf.Perf[0].Min, perf.Perf[0].Max)\r\n        }\r\n \r\n        memPerfs, err := client.ServerMemPerfInfo()\r\n        if err != nil {\r\n                log.Fatalf(\"error obtaining mem perf: %v\", err)\r\n        }\r\n        for _, perf := range memPerfs {\r\n                log.Printf(\"%s's mem utilization: %s\\n\", perf.Addr, perf.Perf[0].Mem)\r\n        }\r\n}\r\nEOF\r\n# run test\r\n$$ go run test.go\r\n2019-01-02 23:34:25.447707 I | 127.0.0.1:9000's cpu utilization avg: 0.07% min: 0.07% max: 0.08%\r\n2019-01-02 23:34:26.744686 I | 127.0.0.1:9000's mem utilization: 69.94M\r\n```\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [ ] I have added unit tests to cover my changes.\r\n- [ ] I have added/updated functional tests in [mint](https://github.com/minio/mint). (If yes, add `mint` PR # here: )\r\n- [ ] All new and existing tests passed.","created_at":"2019-01-02T23:38:50Z","updated_at":"2019-01-04T14:47:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cf5975cf987ea8c0f1795a3ba76bdde3c6d4904","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sinhaashish","id":13465383,"node_id":"MDQ6VXNlcjEzNDY1Mzgz","avatar_url":"https://avatars2.githubusercontent.com/u/13465383?v=4","gravatar_id":"","url":"https://api.github.com/users/sinhaashish","html_url":"https://github.com/sinhaashish","followers_url":"https://api.github.com/users/sinhaashish/followers","following_url":"https://api.github.com/users/sinhaashish/following{/other_user}","gists_url":"https://api.github.com/users/sinhaashish/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhaashish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhaashish/subscriptions","organizations_url":"https://api.github.com/users/sinhaashish/orgs","repos_url":"https://api.github.com/users/sinhaashish/repos","events_url":"https://api.github.com/users/sinhaashish/events{/privacy}","received_events_url":"https://api.github.com/users/sinhaashish/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/minio/minio/pulls/7038/commits","review_comments_url":"https://api.github.com/repos/minio/minio/pulls/7038/comments","review_comment_url":"https://api.github.com/repos/minio/minio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/minio/minio/issues/7038/comments","statuses_url":"https://api.github.com/repos/minio/minio/statuses/46986f71ccba528cf70a544e9af57c05c6f1b648","head":{"label":"wlan0:master","ref":"master","sha":"46986f71ccba528cf70a544e9af57c05c6f1b648","user":{"login":"wlan0","id":1050521,"node_id":"MDQ6VXNlcjEwNTA1MjE=","avatar_url":"https://avatars0.githubusercontent.com/u/1050521?v=4","gravatar_id":"","url":"https://api.github.com/users/wlan0","html_url":"https://github.com/wlan0","followers_url":"https://api.github.com/users/wlan0/followers","following_url":"https://api.github.com/users/wlan0/following{/other_user}","gists_url":"https://api.github.com/users/wlan0/gists{/gist_id}","starred_url":"https://api.github.com/users/wlan0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlan0/subscriptions","organizations_url":"https://api.github.com/users/wlan0/orgs","repos_url":"https://api.github.com/users/wlan0/repos","events_url":"https://api.github.com/users/wlan0/events{/privacy}","received_events_url":"https://api.github.com/users/wlan0/received_events","type":"User","site_admin":false},"repo":{"id":155019003,"node_id":"MDEwOlJlcG9zaXRvcnkxNTUwMTkwMDM=","name":"minio","full_name":"wlan0/minio","private":false,"owner":{"login":"wlan0","id":1050521,"node_id":"MDQ6VXNlcjEwNTA1MjE=","avatar_url":"https://avatars0.githubusercontent.com/u/1050521?v=4","gravatar_id":"","url":"https://api.github.com/users/wlan0","html_url":"https://github.com/wlan0","followers_url":"https://api.github.com/users/wlan0/followers","following_url":"https://api.github.com/users/wlan0/following{/other_user}","gists_url":"https://api.github.com/users/wlan0/gists{/gist_id}","starred_url":"https://api.github.com/users/wlan0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlan0/subscriptions","organizations_url":"https://api.github.com/users/wlan0/orgs","repos_url":"https://api.github.com/users/wlan0/repos","events_url":"https://api.github.com/users/wlan0/events{/privacy}","received_events_url":"https://api.github.com/users/wlan0/received_events","type":"User","site_admin":false},"html_url":"https://github.com/wlan0/minio","description":"Minio is an open source object storage server compatible with Amazon S3 APIs","fork":true,"url":"https://api.github.com/repos/wlan0/minio","forks_url":"https://api.github.com/repos/wlan0/minio/forks","keys_url":"https://api.github.com/repos/wlan0/minio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wlan0/minio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wlan0/minio/teams","hooks_url":"https://api.github.com/repos/wlan0/minio/hooks","issue_events_url":"https://api.github.com/repos/wlan0/minio/issues/events{/number}","events_url":"https://api.github.com/repos/wlan0/minio/events","assignees_url":"https://api.github.com/repos/wlan0/minio/assignees{/user}","branches_url":"https://api.github.com/repos/wlan0/minio/branches{/branch}","tags_url":"https://api.github.com/repos/wlan0/minio/tags","blobs_url":"https://api.github.com/repos/wlan0/minio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wlan0/minio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wlan0/minio/git/refs{/sha}","trees_url":"https://api.github.com/repos/wlan0/minio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wlan0/minio/statuses/{sha}","languages_url":"https://api.github.com/repos/wlan0/minio/languages","stargazers_url":"https://api.github.com/repos/wlan0/minio/stargazers","contributors_url":"https://api.github.com/repos/wlan0/minio/contributors","subscribers_url":"https://api.github.com/repos/wlan0/minio/subscribers","subscription_url":"https://api.github.com/repos/wlan0/minio/subscription","commits_url":"https://api.github.com/repos/wlan0/minio/commits{/sha}","git_commits_url":"https://api.github.com/repos/wlan0/minio/git/commits{/sha}","comments_url":"https://api.github.com/repos/wlan0/minio/comments{/number}","issue_comment_url":"https://api.github.com/repos/wlan0/minio/issues/comments{/number}","contents_url":"https://api.github.com/repos/wlan0/minio/contents/{+path}","compare_url":"https://api.github.com/repos/wlan0/minio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wlan0/minio/merges","archive_url":"https://api.github.com/repos/wlan0/minio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wlan0/minio/downloads","issues_url":"https://api.github.com/repos/wlan0/minio/issues{/number}","pulls_url":"https://api.github.com/repos/wlan0/minio/pulls{/number}","milestones_url":"https://api.github.com/repos/wlan0/minio/milestones{/number}","notifications_url":"https://api.github.com/repos/wlan0/minio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wlan0/minio/labels{/name}","releases_url":"https://api.github.com/repos/wlan0/minio/releases{/id}","deployments_url":"https://api.github.com/repos/wlan0/minio/deployments","created_at":"2018-10-27T23:34:08Z","updated_at":"2019-01-04T13:43:28Z","pushed_at":"2019-01-04T13:43:25Z","git_url":"git://github.com/wlan0/minio.git","ssh_url":"git@github.com:wlan0/minio.git","clone_url":"https://github.com/wlan0/minio.git","svn_url":"https://github.com/wlan0/minio","homepage":"https://minio.io/downloads.html#download-server","size":44870,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"minio:master","ref":"master","sha":"e82dcd195c51720be8b3a822199e05bf771f71d2","user":{"login":"minio","id":695951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NTk1MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/695951?v=4","gravatar_id":"","url":"https://api.github.com/users/minio","html_url":"https://github.com/minio","followers_url":"https://api.github.com/users/minio/followers","following_url":"https://api.github.com/users/minio/following{/other_user}","gists_url":"https://api.github.com/users/minio/gists{/gist_id}","starred_url":"https://api.github.com/users/minio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minio/subscriptions","organizations_url":"https://api.github.com/users/minio/orgs","repos_url":"https://api.github.com/users/minio/repos","events_url":"https://api.github.com/users/minio/events{/privacy}","received_events_url":"https://api.github.com/users/minio/received_events","type":"Organization","site_admin":false},"repo":{"id":29261473,"node_id":"MDEwOlJlcG9zaXRvcnkyOTI2MTQ3Mw==","name":"minio","full_name":"minio/minio","private":false,"owner":{"login":"minio","id":695951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NTk1MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/695951?v=4","gravatar_id":"","url":"https://api.github.com/users/minio","html_url":"https://github.com/minio","followers_url":"https://api.github.com/users/minio/followers","following_url":"https://api.github.com/users/minio/following{/other_user}","gists_url":"https://api.github.com/users/minio/gists{/gist_id}","starred_url":"https://api.github.com/users/minio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minio/subscriptions","organizations_url":"https://api.github.com/users/minio/orgs","repos_url":"https://api.github.com/users/minio/repos","events_url":"https://api.github.com/users/minio/events{/privacy}","received_events_url":"https://api.github.com/users/minio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/minio/minio","description":"Minio is an open source object storage server compatible with Amazon S3 APIs","fork":false,"url":"https://api.github.com/repos/minio/minio","forks_url":"https://api.github.com/repos/minio/minio/forks","keys_url":"https://api.github.com/repos/minio/minio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minio/minio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minio/minio/teams","hooks_url":"https://api.github.com/repos/minio/minio/hooks","issue_events_url":"https://api.github.com/repos/minio/minio/issues/events{/number}","events_url":"https://api.github.com/repos/minio/minio/events","assignees_url":"https://api.github.com/repos/minio/minio/assignees{/user}","branches_url":"https://api.github.com/repos/minio/minio/branches{/branch}","tags_url":"https://api.github.com/repos/minio/minio/tags","blobs_url":"https://api.github.com/repos/minio/minio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minio/minio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minio/minio/git/refs{/sha}","trees_url":"https://api.github.com/repos/minio/minio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minio/minio/statuses/{sha}","languages_url":"https://api.github.com/repos/minio/minio/languages","stargazers_url":"https://api.github.com/repos/minio/minio/stargazers","contributors_url":"https://api.github.com/repos/minio/minio/contributors","subscribers_url":"https://api.github.com/repos/minio/minio/subscribers","subscription_url":"https://api.github.com/repos/minio/minio/subscription","commits_url":"https://api.github.com/repos/minio/minio/commits{/sha}","git_commits_url":"https://api.github.com/repos/minio/minio/git/commits{/sha}","comments_url":"https://api.github.com/repos/minio/minio/comments{/number}","issue_comment_url":"https://api.github.com/repos/minio/minio/issues/comments{/number}","contents_url":"https://api.github.com/repos/minio/minio/contents/{+path}","compare_url":"https://api.github.com/repos/minio/minio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minio/minio/merges","archive_url":"https://api.github.com/repos/minio/minio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minio/minio/downloads","issues_url":"https://api.github.com/repos/minio/minio/issues{/number}","pulls_url":"https://api.github.com/repos/minio/minio/pulls{/number}","milestones_url":"https://api.github.com/repos/minio/minio/milestones{/number}","notifications_url":"https://api.github.com/repos/minio/minio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minio/minio/labels{/name}","releases_url":"https://api.github.com/repos/minio/minio/releases{/id}","deployments_url":"https://api.github.com/repos/minio/minio/deployments","created_at":"2015-01-14T19:23:58Z","updated_at":"2019-01-04T12:48:07Z","pushed_at":"2019-01-04T13:47:35Z","git_url":"git://github.com/minio/minio.git","ssh_url":"git@github.com:minio/minio.git","clone_url":"https://github.com/minio/minio.git","svn_url":"https://github.com/minio/minio","homepage":"https://minio.io/downloads.html#download-server","size":44843,"stargazers_count":14150,"watchers_count":14150,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1285,"mirror_url":null,"archived":false,"open_issues_count":136,"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":1285,"open_issues":136,"watchers":14150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minio/minio/pulls/7038"},"html":{"href":"https://github.com/minio/minio/pull/7038"},"issue":{"href":"https://api.github.com/repos/minio/minio/issues/7038"},"comments":{"href":"https://api.github.com/repos/minio/minio/issues/7038/comments"},"review_comments":{"href":"https://api.github.com/repos/minio/minio/pulls/7038/comments"},"review_comment":{"href":"https://api.github.com/repos/minio/minio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/minio/minio/pulls/7038/commits"},"statuses":{"href":"https://api.github.com/repos/minio/minio/statuses/46986f71ccba528cf70a544e9af57c05c6f1b648"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nitisht"}}