{"action":"created","issue":{"url":"https://api.github.com/repos/lxc/lxcfs/issues/13","repository_url":"https://api.github.com/repos/lxc/lxcfs","labels_url":"https://api.github.com/repos/lxc/lxcfs/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxcfs/issues/13/comments","events_url":"https://api.github.com/repos/lxc/lxcfs/issues/13/events","html_url":"https://github.com/lxc/lxcfs/issues/13","id":58388325,"number":13,"title":"loadavg and swap","user":{"login":"devonblzx","id":8078969,"avatar_url":"https://avatars.githubusercontent.com/u/8078969?v=3","gravatar_id":"","url":"https://api.github.com/users/devonblzx","html_url":"https://github.com/devonblzx","followers_url":"https://api.github.com/users/devonblzx/followers","following_url":"https://api.github.com/users/devonblzx/following{/other_user}","gists_url":"https://api.github.com/users/devonblzx/gists{/gist_id}","starred_url":"https://api.github.com/users/devonblzx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devonblzx/subscriptions","organizations_url":"https://api.github.com/users/devonblzx/orgs","repos_url":"https://api.github.com/users/devonblzx/repos","events_url":"https://api.github.com/users/devonblzx/events{/privacy}","received_events_url":"https://api.github.com/users/devonblzx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-02-20T18:01:25Z","updated_at":"2016-02-09T20:52:50Z","closed_at":null,"body":"Two additional files that should be considered for lxcfs:\r\n\r\n/proc/loadavg\r\n/proc/swaps\r\n\r\nBoth should be relatively easy to generate using cgroups and the existing information in lxcfs.\r\n\r\n# cat /proc/loadavg\r\n0.00 0.01 0.05 1/273 16306\r\n\r\nloadavg consists of 1 minute average, 5 minute average, 10 minute average, running processes / total processes, last PID running\r\n\r\nMy idea was to poll the system every second and keep a database of the last 600 polls (10 minutes) consisting of the number of running processes.  This would allow you to generate averages as needed.\r\n\r\n# cat /proc/swaps\r\nFilename                                Type            Size    Used    Priority\r\n/dev/sdb1                               partition       12582908        49188   -1\r\n\r\nI'd assume you can generate a fake partition entry with integer values from cgroup/memory.\r\n\r\nThe size would be:\r\n(memory.memsw.limit_in_bytes - memory.limit_in_bytes) / 1024\r\n\r\nThe usage can be derived from the 'swap' row in memory.stat divided by 1024 (since /proc/swaps reports in KB)\r\n\r\nI'm not a C programmer so I can't assist with the code, but I'd be happy to help in ways that I can."},"comment":{"url":"https://api.github.com/repos/lxc/lxcfs/issues/comments/182061274","html_url":"https://github.com/lxc/lxcfs/issues/13#issuecomment-182061274","issue_url":"https://api.github.com/repos/lxc/lxcfs/issues/13","id":182061274,"user":{"login":"nehaljwani","id":1779189,"avatar_url":"https://avatars.githubusercontent.com/u/1779189?v=3","gravatar_id":"","url":"https://api.github.com/users/nehaljwani","html_url":"https://github.com/nehaljwani","followers_url":"https://api.github.com/users/nehaljwani/followers","following_url":"https://api.github.com/users/nehaljwani/following{/other_user}","gists_url":"https://api.github.com/users/nehaljwani/gists{/gist_id}","starred_url":"https://api.github.com/users/nehaljwani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nehaljwani/subscriptions","organizations_url":"https://api.github.com/users/nehaljwani/orgs","repos_url":"https://api.github.com/users/nehaljwani/repos","events_url":"https://api.github.com/users/nehaljwani/events{/privacy}","received_events_url":"https://api.github.com/users/nehaljwani/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T20:52:50Z","updated_at":"2016-02-09T20:52:50Z","body":"@hallyn I was just about to send the PR, when I saw 70dcc12e30eede95de6a4145bcbebd87aa6c3eeb. Missed by by an hour :)"}}