moby/docs
Ian Campbell 9b001c4f5f Correct CPU usage calculation in presence of offline CPUs and newer Linux
In https://github.com/torvalds/linux/commit/5ca3726 (released in v4.7-rc1) the
content of the `cpuacct.usage_percpu` file in sysfs was changed to include both
online and offline cpus. This broke the arithmetic in the stats helpers used by
`docker stats`, since it was using the length of the PerCPUUsage array as a
proxy for the number of online CPUs.

Add current number of online CPUs to types.StatsJSON and use it in the
calculation.

Keep a fallback to `len(v.CPUStats.CPUUsage.PercpuUsage)` so this code
continues to work when talking to an older daemon. An old client talking to a
new daemon will ignore the new field and behave as before.

Fixes #28941.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
(cherry picked from commit 115f91d757)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-03-13 16:16:05 -07:00
..
api Correct CPU usage calculation in presence of offline CPUs and newer Linux 2017-03-13 16:16:05 -07:00
extend Merge pull request #31023 from mstanleyjones/fix_liquid_errors 2017-02-22 00:49:10 +01:00
reference Merge pull request #31467 from thaJeztah/remove-jekyll-markers 2017-03-02 11:03:57 +01:00
static_files Putting back the missing image back in the repo. 2016-10-26 12:34:24 +05:30
deprecated.md Merge pull request #31023 from mstanleyjones/fix_liquid_errors 2017-02-22 00:49:10 +01:00
README.md Sync docker/docker refs with files mistakenly edited in docker.github.io repo 2016-10-20 10:51:30 -07:00

The non-reference docs have been moved!

The documentation for Docker Engine has been merged into the general documentation repo.

See the README for instructions on contributing to and building the documentation.

If you'd like to edit the current published version of the Engine docs, do it in the master branch here: https://github.com/docker/docker.github.io/tree/master/engine

If you need to document the functionality of an upcoming Engine release, use the vnext-engine branch: https://github.com/docker/docker.github.io/tree/vnext-engine/engine

The reference docs have been left in docker/docker (this repo), which remains the place to edit them.

The docs in the general repo are open-source and we appreciate your feedback and pull requests!