{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/22691881","id":22691881,"diff_hunk":"@@ -41,23 +42,23 @@ type driver struct {\n \troot             string\n \tinitPath         string\n \tactiveContainers map[string]*activeContainer\n+\tmachineMemory    int64\n \tsync.Mutex\n }\n \n-func NewDriver(root, initPath string) (*driver, error) {\n+func NewDriver(root, initPath string, machineMemory int64) (*driver, error) {","path":"daemon/execdriver/native/driver.go","position":17,"original_position":17,"commit_id":"0f3f2bbde3826d80b1dec9f1cb986ef0b3ae7422","original_commit_id":"917b1f1421b5c5091da54aefa8829d26a73c88ea","user":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"body":"No good reason \r\n","created_at":"2015-01-08T23:32:58Z","updated_at":"2015-01-08T23:32:58Z","html_url":"https://github.com/docker/docker/pull/9984#discussion_r22691881","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/9984","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/22691881"},"html":{"href":"https://github.com/docker/docker/pull/9984#discussion_r22691881"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/9984"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/9984","id":27067681,"html_url":"https://github.com/docker/docker/pull/9984","diff_url":"https://github.com/docker/docker/pull/9984.diff","patch_url":"https://github.com/docker/docker/pull/9984.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/9984","number":9984,"state":"open","locked":false,"title":"docker stats live container resource metrics","user":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"body":"This is still a little WIP, opening to get some feedback, as it still needs docs and stuff.\r\n\r\nThis PR allows you to receive live container metrics for your containers.  You can use the `docker stats <containers...>` cli command to get a live top like interface.  This only displays a few of the metrics available.  \r\n\r\n```bash\r\ndocker stats insurgency1 insurgency2 insurgency3 minecraft-family redis\r\n\r\nCONTAINER           CPU %               MEM USAGE/LIMIT     MEM %               NET I/O\r\ninsurgency1         3.62%               244.4 MB/2.099 GB   11.64%              0 B/0 B\r\ninsurgency2         4.65%               135.6 MB/2.099 GB   6.46%               0 B/0 B\r\ninsurgency3         3.65%               79.18 MB/2.099 GB   3.77%               0 B/0 B\r\nminecraft-family    14.13%              408.6 MB/2.099 GB   19.47%              0 B/0 B\r\nredis               0.17%               6.558 MB/67.11 MB   9.77%               648 B/648 B\r\n```\r\n\r\nFor people who require more information they can subscribe to the container's stats stream and receive more information such as blkio information.  \r\n\r\nGET `/v1/containers/redis/stats`\r\n\r\n```json\r\n{\r\n   \"read\" : \"2015-01-08T22:57:31.547920715Z\",\r\n   \"interval\" : 0,\r\n   \"network\" : {\r\n      \"rx_dropped\" : 0,\r\n      \"rx_bytes\" : 648,\r\n      \"rx_errors\" : 0,\r\n      \"tx_packets\" : 8,\r\n      \"tx_dropped\" : 0,\r\n      \"rx_packets\" : 8,\r\n      \"tx_errors\" : 0,\r\n      \"tx_bytes\" : 648\r\n   },\r\n   \"memory_stats\" : {\r\n      \"stats\" : {\r\n         \"total_pgmajfault\" : 0,\r\n         \"cache\" : 0,\r\n         \"mapped_file\" : 0,\r\n         \"total_inactive_file\" : 0,\r\n         \"pgpgout\" : 414,\r\n         \"rss\" : 6537216,\r\n         \"total_mapped_file\" : 0,\r\n         \"writeback\" : 0,\r\n         \"unevictable\" : 0,\r\n         \"pgpgin\" : 477,\r\n         \"total_unevictable\" : 0,\r\n         \"pgmajfault\" : 0,\r\n         \"total_rss\" : 6537216,\r\n         \"total_rss_huge\" : 6291456,\r\n         \"total_writeback\" : 0,\r\n         \"total_inactive_anon\" : 0,\r\n         \"rss_huge\" : 6291456,\r\n         \"hierarchical_memory_limit\" : 67108864,\r\n         \"total_pgfault\" : 964,\r\n         \"total_active_file\" : 0,\r\n         \"active_anon\" : 6537216,\r\n         \"total_active_anon\" : 6537216,\r\n         \"total_pgpgout\" : 414,\r\n         \"total_cache\" : 0,\r\n         \"inactive_anon\" : 0,\r\n         \"active_file\" : 0,\r\n         \"pgfault\" : 964,\r\n         \"inactive_file\" : 0,\r\n         \"total_pgpgin\" : 477\r\n      },\r\n      \"max_usage\" : 6651904,\r\n      \"usage\" : 6537216,\r\n      \"failcnt\" : 0,\r\n      \"limit\" : 67108864\r\n   },\r\n   \"clock_ticks\" : 100,\r\n   \"blkio_stats\" : {},\r\n   \"cpu_stats\" : {\r\n      \"cpu_usage\" : {\r\n         \"percpu_usage\" : [\r\n            16970827,\r\n            1839451,\r\n            7107380,\r\n            10571290\r\n         ],\r\n         \"usage_in_usermode\" : 10000000,\r\n         \"total_usage\" : 36488948,\r\n         \"usage_in_kernelmode\" : 20000000\r\n      },\r\n      \"system_cpu_usage\" : 20091722000000000,\r\n      \"throttling_data\" : {}\r\n   }\r\n}\r\n```","created_at":"2015-01-08T23:04:06Z","updated_at":"2015-01-08T23:32:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0aa8597aac2a204fa468778b929179028e9754af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/9984/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/9984/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments/{number}","comments_url":"https://api.github.com/repos/docker/docker/issues/9984/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/0f3f2bbde3826d80b1dec9f1cb986ef0b3ae7422","head":{"label":"crosbymichael:metrics","ref":"metrics","sha":"0f3f2bbde3826d80b1dec9f1cb986ef0b3ae7422","user":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"repo":{"id":13808553,"name":"docker","full_name":"crosbymichael/docker","owner":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crosbymichael/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/crosbymichael/docker","forks_url":"https://api.github.com/repos/crosbymichael/docker/forks","keys_url":"https://api.github.com/repos/crosbymichael/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crosbymichael/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crosbymichael/docker/teams","hooks_url":"https://api.github.com/repos/crosbymichael/docker/hooks","issue_events_url":"https://api.github.com/repos/crosbymichael/docker/issues/events{/number}","events_url":"https://api.github.com/repos/crosbymichael/docker/events","assignees_url":"https://api.github.com/repos/crosbymichael/docker/assignees{/user}","branches_url":"https://api.github.com/repos/crosbymichael/docker/branches{/branch}","tags_url":"https://api.github.com/repos/crosbymichael/docker/tags","blobs_url":"https://api.github.com/repos/crosbymichael/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crosbymichael/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crosbymichael/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/crosbymichael/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crosbymichael/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/crosbymichael/docker/languages","stargazers_url":"https://api.github.com/repos/crosbymichael/docker/stargazers","contributors_url":"https://api.github.com/repos/crosbymichael/docker/contributors","subscribers_url":"https://api.github.com/repos/crosbymichael/docker/subscribers","subscription_url":"https://api.github.com/repos/crosbymichael/docker/subscription","commits_url":"https://api.github.com/repos/crosbymichael/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/crosbymichael/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/crosbymichael/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/crosbymichael/docker/issues/comments/{number}","contents_url":"https://api.github.com/repos/crosbymichael/docker/contents/{+path}","compare_url":"https://api.github.com/repos/crosbymichael/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crosbymichael/docker/merges","archive_url":"https://api.github.com/repos/crosbymichael/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crosbymichael/docker/downloads","issues_url":"https://api.github.com/repos/crosbymichael/docker/issues{/number}","pulls_url":"https://api.github.com/repos/crosbymichael/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/crosbymichael/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/crosbymichael/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crosbymichael/docker/labels{/name}","releases_url":"https://api.github.com/repos/crosbymichael/docker/releases{/id}","created_at":"2013-10-23T16:42:55Z","updated_at":"2014-12-19T19:08:54Z","pushed_at":"2015-01-08T23:32:34Z","git_url":"git://github.com/crosbymichael/docker.git","ssh_url":"git@github.com:crosbymichael/docker.git","clone_url":"https://github.com/crosbymichael/docker.git","svn_url":"https://github.com/crosbymichael/docker","homepage":"http://www.docker.io","size":41999,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"273472a5c21075fa6fd223e30ddd6451fa180044","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments/{number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-01-08T22:49:45Z","pushed_at":"2015-01-08T22:19:25Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":122930,"stargazers_count":18225,"watchers_count":18225,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3703,"mirror_url":null,"open_issues_count":1001,"forks":3703,"open_issues":1001,"watchers":18225,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/9984"},"html":{"href":"https://github.com/docker/docker/pull/9984"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/9984"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/9984/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/9984/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/9984/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/0f3f2bbde3826d80b1dec9f1cb986ef0b3ae7422"}}}}