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