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:
commit
9835062f4a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user