Merge pull request #136 from rjnagal/cpumask

Fix cpu gauge to show percent of machine cpu capacity being used by a container.
This commit is contained in:
Victor Marmol 2014-07-28 15:23:10 -07:00
commit 9835062f4a

View File

@ -168,7 +168,7 @@ function drawOverallUsage(elementId, machineInfo, containerInfo) {
var rawUsage = cur.cpu.usage.total - prev.cpu.usage.total;
// Convert to millicores and take the percentage
cpuUsage = Math.round(((rawUsage / 1000000) / containerInfo.spec.cpu.limit) * 100);
cpuUsage = Math.round(((rawUsage / 1000000) / (machineInfo.num_cores * 1000)) * 100);
if (cpuUsage > 100) {
cpuUsage = 100;
}