1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

B #5420: Fix real CPU & MEM bars on ESX host table (#1285)

(cherry picked from commit 3bf4870a94617688d750041331ada101e0954bc5)
This commit is contained in:
Frederick Borges 2021-06-09 15:51:28 +02:00 committed by Tino Vazquez
parent 96b0925567
commit f3843fa2d3
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 10 additions and 10 deletions

View File

@ -36,15 +36,15 @@ define(function(require) {
var allocatedCPU = parseInt(hostShare.CPU_USAGE,10);
if (maxCPU > 0) {
var ratioAllocatedCPU = Math.round((allocatedCPU / maxCPU) * 100);
infoStr = allocatedCPU + ' / ' + maxCPU + ' (' + ratioAllocatedCPU + '%)';
} else {
infoStr = "";
}
allocatedCPUBar = ProgressBar.html(allocatedCPU, maxCPU, infoStr);
infoStr = allocatedCPU + ' / ' + maxCPU + ' (' + ratioAllocatedCPU + '%)';
} else {
infoStr = "";
}
var realCPUBar
allocatedCPUBar = ProgressBar.html(allocatedCPU, maxCPU, infoStr);
}
var realCPUBar;
if (hostMonitoring && hostMonitoring.USED_CPU) {
var totalCPU = parseInt(hostShare.TOTAL_CPU||0);
var totalCPU = hostShareFlag ? parseInt(hostShare.MAX_CPU||0) : parseInt(hostShare.TOTAL_CPU||0);
var realCPU = parseInt(hostMonitoring.USED_CPU,10);
if (totalCPU > 0) {
var ratioRealCPU = Math.round((realCPU / totalCPU) * 100);

View File

@ -43,9 +43,9 @@ define(function(require) {
allocatedMemBar = ProgressBar.html(allocatedMem, maxMem, infoStr);
}
var realMemBar;
if (hostMonitoring && hostMonitoring.USED_MEMORY) {
var totalMem = parseInt(hostShare.TOTAL_MEM||0);
var realMem = parseInt(hostMonitoring.USED_MEMORY,10);
if (hostMonitoring && (hostMonitoring.USED_MEMORY || hostMonitoring.USED_MEM)) {
var totalMem = hostShareFlag ? parseInt(hostShare.MAX_MEM||0) : parseInt(hostShare.TOTAL_MEM||0);
var realMem = hostShareFlag ? parseInt(hostMonitoring.USED_MEM,10) : parseInt(hostMonitoring.USED_MEMORY,10);
if (totalMem > 0) {
var ratioRealMem = Math.round((realMem / totalMem) * 100);
infoStr = Humanize.size(realMem) + ' / ' + Humanize.size(totalMem) + ' (' + ratioRealMem + '%)';