{"action":"created","comment":{"url":"https://api.github.com/repos/google/cadvisor/pulls/comments/231285538","pull_request_review_id":172224835,"id":231285538,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTI4NTUzOA==","diff_hunk":"@@ -132,6 +144,35 @@ func (h *Handler) GetStats() (*info.ContainerStats, error) {\n \treturn stats, nil\n }\n \n+func processStatsFromProcs(rootFs string, cgroupPath string) (info.ProcessStats, error) {\n+\tvar fdCount uint64\n+\tfilePath := path.Join(cgroupPath, \"cgroup.procs\")\n+\tout, err := ioutil.ReadFile(filePath)\n+\tif err != nil {\n+\t\treturn info.ProcessStats{}, fmt.Errorf(\"couldn't open cpu cgroup procs file %v : %v\", filePath, err)\n+\t}\n+\n+\tpids := strings.Split(string(out), \"\\n\")\n+\tfor _, pid := range pids {\n+\t\tdirPath := path.Join(rootFs, \"/proc\", pid, \"fd\")\n+\t\tfds, err := ioutil.ReadDir(dirPath)\n+\t\tif err != nil {\n+\t\t\tglog.V(4).Infof(\"error while listing directory %q to measure fd count: %v\", dirPath, err)\n+\t\t\tcontinue\n+\t\t}\n+\t\tfdCount += uint64(len(fds))\n+\t}\n+\n+\tprocessStats := info.ProcessStats{\n+\t\t// EOL is also treated as a new line while reading \"cgroup.procs\" file with ioutil.ReadFile.","path":"container/libcontainer/handler.go","position":43,"original_position":43,"commit_id":"f685b3efce1303709174ab2b500caba648457e7e","original_commit_id":"f685b3efce1303709174ab2b500caba648457e7e","user":{"login":"dashpole","id":3262098,"node_id":"MDQ6VXNlcjMyNjIwOTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3262098?v=4","gravatar_id":"","url":"https://api.github.com/users/dashpole","html_url":"https://github.com/dashpole","followers_url":"https://api.github.com/users/dashpole/followers","following_url":"https://api.github.com/users/dashpole/following{/other_user}","gists_url":"https://api.github.com/users/dashpole/gists{/gist_id}","starred_url":"https://api.github.com/users/dashpole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dashpole/subscriptions","organizations_url":"https://api.github.com/users/dashpole/orgs","repos_url":"https://api.github.com/users/dashpole/repos","events_url":"https://api.github.com/users/dashpole/events{/privacy}","received_events_url":"https://api.github.com/users/dashpole/received_events","type":"User","site_admin":false},"body":"so does this mean one of the pids in our list above isn't actually a pid, but an empty string (or something else)?  Can we just remove this from the list of pids above instead of this?","created_at":"2018-11-06T20:47:36Z","updated_at":"2018-11-06T20:47:37Z","html_url":"https://github.com/google/cadvisor/pull/2093#discussion_r231285538","pull_request_url":"https://api.github.com/repos/google/cadvisor/pulls/2093","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/cadvisor/pulls/comments/231285538"},"html":{"href":"https://github.com/google/cadvisor/pull/2093#discussion_r231285538"},"pull_request":{"href":"https://api.github.com/repos/google/cadvisor/pulls/2093"}}},"pull_request":{"url":"https://api.github.com/repos/google/cadvisor/pulls/2093","id":228547890,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NTQ3ODkw","html_url":"https://github.com/google/cadvisor/pull/2093","diff_url":"https://github.com/google/cadvisor/pull/2093.diff","patch_url":"https://github.com/google/cadvisor/pull/2093.patch","issue_url":"https://api.github.com/repos/google/cadvisor/issues/2093","number":2093,"state":"open","locked":false,"title":"Cache process metrics","user":{"login":"sashankreddya","id":33848528,"node_id":"MDQ6VXNlcjMzODQ4NTI4","avatar_url":"https://avatars1.githubusercontent.com/u/33848528?v=4","gravatar_id":"","url":"https://api.github.com/users/sashankreddya","html_url":"https://github.com/sashankreddya","followers_url":"https://api.github.com/users/sashankreddya/followers","following_url":"https://api.github.com/users/sashankreddya/following{/other_user}","gists_url":"https://api.github.com/users/sashankreddya/gists{/gist_id}","starred_url":"https://api.github.com/users/sashankreddya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashankreddya/subscriptions","organizations_url":"https://api.github.com/users/sashankreddya/orgs","repos_url":"https://api.github.com/users/sashankreddya/repos","events_url":"https://api.github.com/users/sashankreddya/events{/privacy}","received_events_url":"https://api.github.com/users/sashankreddya/received_events","type":"User","site_admin":false},"body":"Cache the process stats (ProcessCount, File Descriptor Count) of a container, so that the response time is improved.","created_at":"2018-11-06T01:33:42Z","updated_at":"2018-11-06T20:47:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"546d82d298ea846993e2121a567b3f935eaff183","assignee":{"login":"dashpole","id":3262098,"node_id":"MDQ6VXNlcjMyNjIwOTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3262098?v=4","gravatar_id":"","url":"https://api.github.com/users/dashpole","html_url":"https://github.com/dashpole","followers_url":"https://api.github.com/users/dashpole/followers","following_url":"https://api.github.com/users/dashpole/following{/other_user}","gists_url":"https://api.github.com/users/dashpole/gists{/gist_id}","starred_url":"https://api.github.com/users/dashpole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dashpole/subscriptions","organizations_url":"https://api.github.com/users/dashpole/orgs","repos_url":"https://api.github.com/users/dashpole/repos","events_url":"https://api.github.com/users/dashpole/events{/privacy}","received_events_url":"https://api.github.com/users/dashpole/received_events","type":"User","site_admin":false},"assignees":[{"login":"dashpole","id":3262098,"node_id":"MDQ6VXNlcjMyNjIwOTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3262098?v=4","gravatar_id":"","url":"https://api.github.com/users/dashpole","html_url":"https://github.com/dashpole","followers_url":"https://api.github.com/users/dashpole/followers","following_url":"https://api.github.com/users/dashpole/following{/other_user}","gists_url":"https://api.github.com/users/dashpole/gists{/gist_id}","starred_url":"https://api.github.com/users/dashpole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dashpole/subscriptions","organizations_url":"https://api.github.com/users/dashpole/orgs","repos_url":"https://api.github.com/users/dashpole/repos","events_url":"https://api.github.com/users/dashpole/events{/privacy}","received_events_url":"https://api.github.com/users/dashpole/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/cadvisor/pulls/2093/commits","review_comments_url":"https://api.github.com/repos/google/cadvisor/pulls/2093/comments","review_comment_url":"https://api.github.com/repos/google/cadvisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/cadvisor/issues/2093/comments","statuses_url":"https://api.github.com/repos/google/cadvisor/statuses/f685b3efce1303709174ab2b500caba648457e7e","head":{"label":"sashankreddya:cache_process_metrics","ref":"cache_process_metrics","sha":"f685b3efce1303709174ab2b500caba648457e7e","user":{"login":"sashankreddya","id":33848528,"node_id":"MDQ6VXNlcjMzODQ4NTI4","avatar_url":"https://avatars1.githubusercontent.com/u/33848528?v=4","gravatar_id":"","url":"https://api.github.com/users/sashankreddya","html_url":"https://github.com/sashankreddya","followers_url":"https://api.github.com/users/sashankreddya/followers","following_url":"https://api.github.com/users/sashankreddya/following{/other_user}","gists_url":"https://api.github.com/users/sashankreddya/gists{/gist_id}","starred_url":"https://api.github.com/users/sashankreddya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashankreddya/subscriptions","organizations_url":"https://api.github.com/users/sashankreddya/orgs","repos_url":"https://api.github.com/users/sashankreddya/repos","events_url":"https://api.github.com/users/sashankreddya/events{/privacy}","received_events_url":"https://api.github.com/users/sashankreddya/received_events","type":"User","site_admin":false},"repo":{"id":118055794,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwNTU3OTQ=","name":"cadvisor","full_name":"sashankreddya/cadvisor","private":false,"owner":{"login":"sashankreddya","id":33848528,"node_id":"MDQ6VXNlcjMzODQ4NTI4","avatar_url":"https://avatars1.githubusercontent.com/u/33848528?v=4","gravatar_id":"","url":"https://api.github.com/users/sashankreddya","html_url":"https://github.com/sashankreddya","followers_url":"https://api.github.com/users/sashankreddya/followers","following_url":"https://api.github.com/users/sashankreddya/following{/other_user}","gists_url":"https://api.github.com/users/sashankreddya/gists{/gist_id}","starred_url":"https://api.github.com/users/sashankreddya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashankreddya/subscriptions","organizations_url":"https://api.github.com/users/sashankreddya/orgs","repos_url":"https://api.github.com/users/sashankreddya/repos","events_url":"https://api.github.com/users/sashankreddya/events{/privacy}","received_events_url":"https://api.github.com/users/sashankreddya/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sashankreddya/cadvisor","description":"Analyzes resource usage and performance characteristics of running containers.","fork":true,"url":"https://api.github.com/repos/sashankreddya/cadvisor","forks_url":"https://api.github.com/repos/sashankreddya/cadvisor/forks","keys_url":"https://api.github.com/repos/sashankreddya/cadvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sashankreddya/cadvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sashankreddya/cadvisor/teams","hooks_url":"https://api.github.com/repos/sashankreddya/cadvisor/hooks","issue_events_url":"https://api.github.com/repos/sashankreddya/cadvisor/issues/events{/number}","events_url":"https://api.github.com/repos/sashankreddya/cadvisor/events","assignees_url":"https://api.github.com/repos/sashankreddya/cadvisor/assignees{/user}","branches_url":"https://api.github.com/repos/sashankreddya/cadvisor/branches{/branch}","tags_url":"https://api.github.com/repos/sashankreddya/cadvisor/tags","blobs_url":"https://api.github.com/repos/sashankreddya/cadvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sashankreddya/cadvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sashankreddya/cadvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/sashankreddya/cadvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sashankreddya/cadvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/sashankreddya/cadvisor/languages","stargazers_url":"https://api.github.com/repos/sashankreddya/cadvisor/stargazers","contributors_url":"https://api.github.com/repos/sashankreddya/cadvisor/contributors","subscribers_url":"https://api.github.com/repos/sashankreddya/cadvisor/subscribers","subscription_url":"https://api.github.com/repos/sashankreddya/cadvisor/subscription","commits_url":"https://api.github.com/repos/sashankreddya/cadvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/sashankreddya/cadvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/sashankreddya/cadvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/sashankreddya/cadvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/sashankreddya/cadvisor/contents/{+path}","compare_url":"https://api.github.com/repos/sashankreddya/cadvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sashankreddya/cadvisor/merges","archive_url":"https://api.github.com/repos/sashankreddya/cadvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sashankreddya/cadvisor/downloads","issues_url":"https://api.github.com/repos/sashankreddya/cadvisor/issues{/number}","pulls_url":"https://api.github.com/repos/sashankreddya/cadvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/sashankreddya/cadvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/sashankreddya/cadvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sashankreddya/cadvisor/labels{/name}","releases_url":"https://api.github.com/repos/sashankreddya/cadvisor/releases{/id}","deployments_url":"https://api.github.com/repos/sashankreddya/cadvisor/deployments","created_at":"2018-01-19T00:37:02Z","updated_at":"2018-11-06T01:17:26Z","pushed_at":"2018-11-06T19:46:30Z","git_url":"git://github.com/sashankreddya/cadvisor.git","ssh_url":"git@github.com:sashankreddya/cadvisor.git","clone_url":"https://github.com/sashankreddya/cadvisor.git","svn_url":"https://github.com/sashankreddya/cadvisor","homepage":"","size":28403,"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":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"48605ecb890830c18de81ae6917e419f61356ec9","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":20653934,"node_id":"MDEwOlJlcG9zaXRvcnkyMDY1MzkzNA==","name":"cadvisor","full_name":"google/cadvisor","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/cadvisor","description":"Analyzes resource usage and performance characteristics of running containers.","fork":false,"url":"https://api.github.com/repos/google/cadvisor","forks_url":"https://api.github.com/repos/google/cadvisor/forks","keys_url":"https://api.github.com/repos/google/cadvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/cadvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/cadvisor/teams","hooks_url":"https://api.github.com/repos/google/cadvisor/hooks","issue_events_url":"https://api.github.com/repos/google/cadvisor/issues/events{/number}","events_url":"https://api.github.com/repos/google/cadvisor/events","assignees_url":"https://api.github.com/repos/google/cadvisor/assignees{/user}","branches_url":"https://api.github.com/repos/google/cadvisor/branches{/branch}","tags_url":"https://api.github.com/repos/google/cadvisor/tags","blobs_url":"https://api.github.com/repos/google/cadvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/cadvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/cadvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/cadvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/cadvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/google/cadvisor/languages","stargazers_url":"https://api.github.com/repos/google/cadvisor/stargazers","contributors_url":"https://api.github.com/repos/google/cadvisor/contributors","subscribers_url":"https://api.github.com/repos/google/cadvisor/subscribers","subscription_url":"https://api.github.com/repos/google/cadvisor/subscription","commits_url":"https://api.github.com/repos/google/cadvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/cadvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/cadvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/cadvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/cadvisor/contents/{+path}","compare_url":"https://api.github.com/repos/google/cadvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/cadvisor/merges","archive_url":"https://api.github.com/repos/google/cadvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/cadvisor/downloads","issues_url":"https://api.github.com/repos/google/cadvisor/issues{/number}","pulls_url":"https://api.github.com/repos/google/cadvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/google/cadvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/google/cadvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/cadvisor/labels{/name}","releases_url":"https://api.github.com/repos/google/cadvisor/releases{/id}","deployments_url":"https://api.github.com/repos/google/cadvisor/deployments","created_at":"2014-06-09T16:36:33Z","updated_at":"2018-11-06T18:08:38Z","pushed_at":"2018-11-06T19:46:33Z","git_url":"git://github.com/google/cadvisor.git","ssh_url":"git@github.com:google/cadvisor.git","clone_url":"https://github.com/google/cadvisor.git","svn_url":"https://github.com/google/cadvisor","homepage":"","size":28448,"stargazers_count":8188,"watchers_count":8188,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1188,"mirror_url":null,"archived":false,"open_issues_count":318,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1188,"open_issues":318,"watchers":8188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/cadvisor/pulls/2093"},"html":{"href":"https://github.com/google/cadvisor/pull/2093"},"issue":{"href":"https://api.github.com/repos/google/cadvisor/issues/2093"},"comments":{"href":"https://api.github.com/repos/google/cadvisor/issues/2093/comments"},"review_comments":{"href":"https://api.github.com/repos/google/cadvisor/pulls/2093/comments"},"review_comment":{"href":"https://api.github.com/repos/google/cadvisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/cadvisor/pulls/2093/commits"},"statuses":{"href":"https://api.github.com/repos/google/cadvisor/statuses/f685b3efce1303709174ab2b500caba648457e7e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dashpole"}}