处理大屏展示资源使用情况问题

develop
bayuzhen 2024-05-30 16:58:09 +08:00
parent 79ca2cfcc2
commit 0c472d7357
1 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ public class ResourceScreenServiceImpl implements ResourceScreenService {
cpuTotal += config.getCpuCore() * config.getCpuAmount() * excessRatio;
memTotal += config.getMemoryCapacity().longValue() * excessRatio;
} else {
cpuTotal += (long) config.getCpuCore() * config.getCpuAmount();
cpuTotal += (long) config.getCpuCore() * Optional.ofNullable(config.getCpuAmount()).orElse(0);
memTotal += config.getMemoryCapacity().longValue();
}
diskTotal += config.getDiskCapacity().intValue();
@ -149,7 +149,7 @@ public class ResourceScreenServiceImpl implements ResourceScreenService {
.collect(Collectors.toList());
for (com.bocloud.ims.entity.resource.Server opServer : opServers) {
com.bocloud.ims.entity.resource.ServerConfig config = opServer.getConfig();
cpuTotal += (long) config.getCpuCore() * config.getCpuAmount();
cpuTotal += (long) config.getCpuCore() * Optional.ofNullable(config.getCpuAmount()).orElse(0);
diskTotal += config.getDiskCapacity().intValue();
memTotal += config.getMemoryCapacity().longValue();
}