修改:Hpc节点资源增加可用节点总数
This commit is contained in:
@@ -9,6 +9,12 @@ import java.util.List;
|
||||
@Data
|
||||
public class HpcResouceInfo {
|
||||
|
||||
@Schema(description = "资源总数")
|
||||
public int totalNodes;
|
||||
|
||||
@Schema(description = "资源可用数")
|
||||
public int freeNodes;
|
||||
|
||||
@Schema(description = "资源总核数")
|
||||
public int totalCores;
|
||||
|
||||
|
||||
@@ -147,8 +147,10 @@ public class IPbsHpcServiceImpl implements IPbsService {
|
||||
int totalCores = 0;
|
||||
int usedCores = 0;
|
||||
int freeCoresSum = 0;
|
||||
int totalNodes=0;
|
||||
int freeNodes=0;
|
||||
List<HpcNodeInfo> nodeInfos = new ArrayList<>(nodes.size());
|
||||
|
||||
totalNodes = nodes.size();
|
||||
for (NodeList node : nodes) {
|
||||
if (node == null) {
|
||||
continue;
|
||||
@@ -166,6 +168,7 @@ public class IPbsHpcServiceImpl implements IPbsService {
|
||||
totalCores += max;
|
||||
usedCores += run;
|
||||
freeCoresSum += free;
|
||||
freeNodes=freeNodes+1;
|
||||
}
|
||||
nodeInfos.add(info);
|
||||
}
|
||||
@@ -173,6 +176,8 @@ public class IPbsHpcServiceImpl implements IPbsService {
|
||||
result.setUsedCores(usedCores);
|
||||
result.setFreeCores(freeCoresSum);
|
||||
result.setNodeList(nodeInfos);
|
||||
result.setTotalNodes(totalNodes);
|
||||
result.setFreeNodes(freeNodes);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user