{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/13627","labels_url":"https://api.github.com/repos/docker/docker/issues/13627/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/13627/comments","events_url":"https://api.github.com/repos/docker/docker/issues/13627/events","html_url":"https://github.com/docker/docker/pull/13627","id":83306379,"number":13627,"title":"update stats.go,Update \"docker stats \" calculations ","user":{"login":"Liuyanglong","id":1468470,"avatar_url":"https://avatars.githubusercontent.com/u/1468470?v=3","gravatar_id":"","url":"https://api.github.com/users/Liuyanglong","html_url":"https://github.com/Liuyanglong","followers_url":"https://api.github.com/users/Liuyanglong/followers","following_url":"https://api.github.com/users/Liuyanglong/following{/other_user}","gists_url":"https://api.github.com/users/Liuyanglong/gists{/gist_id}","starred_url":"https://api.github.com/users/Liuyanglong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Liuyanglong/subscriptions","organizations_url":"https://api.github.com/users/Liuyanglong/orgs","repos_url":"https://api.github.com/users/Liuyanglong/repos","events_url":"https://api.github.com/users/Liuyanglong/events{/privacy}","received_events_url":"https://api.github.com/users/Liuyanglong/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/0-triage","name":"status/0-triage","color":"EEEEEE"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-01T04:30:48Z","updated_at":"2015-09-18T09:49:03Z","closed_at":"2015-06-01T14:28:10Z","pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/13627","html_url":"https://github.com/docker/docker/pull/13627","diff_url":"https://github.com/docker/docker/pull/13627.diff","patch_url":"https://github.com/docker/docker/pull/13627.patch"},"body":"bug fix https://github.com/docker/docker/issues/13626\r\n\r\nWhen I read source code about \" docker stat\", the current is : \r\ncpuPercent = (cpuDelta / systemDelta) * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) \r\nhttps://github.com/docker/docker/blob/0d445685b8d628a938790e50517f3fb949b300e0/api/client/stats.go#L199\r\n\r\nI do not understand why \" * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) \", (cpuDelta / systemDelta) is Correct。\r\n\r\ncpuDelta = float64(v.CpuStats.CpuUsage.TotalUsage - previousCPU)\r\nsystemDelta = float64(v.CpuStats.SystemUsage - previousSystem)\r\n\r\nso total cpu delta / total system delta is correct , not need to multiplied by CPU kernal count."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/141406804","html_url":"https://github.com/docker/docker/pull/13627#issuecomment-141406804","issue_url":"https://api.github.com/repos/docker/docker/issues/13627","id":141406804,"user":{"login":"HuKeping","id":9958621,"avatar_url":"https://avatars.githubusercontent.com/u/9958621?v=3","gravatar_id":"","url":"https://api.github.com/users/HuKeping","html_url":"https://github.com/HuKeping","followers_url":"https://api.github.com/users/HuKeping/followers","following_url":"https://api.github.com/users/HuKeping/following{/other_user}","gists_url":"https://api.github.com/users/HuKeping/gists{/gist_id}","starred_url":"https://api.github.com/users/HuKeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuKeping/subscriptions","organizations_url":"https://api.github.com/users/HuKeping/orgs","repos_url":"https://api.github.com/users/HuKeping/repos","events_url":"https://api.github.com/users/HuKeping/events{/privacy}","received_events_url":"https://api.github.com/users/HuKeping/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T09:49:03Z","updated_at":"2015-09-18T09:49:03Z","body":"Do we need to add this to the docs? I've been asked for so many times about the \"over 100 percentage of CPU usage of Docker\""}}