|
@@ -47,10 +47,10 @@ public class HomePageService {
|
|
|
long gpuSum = systemServerPOList.stream().mapToLong(SystemServerPO::getGpuTotal).sum(); // 显存之和
|
|
|
HardwareVO build = HardwareVO.builder()
|
|
|
.serverNumber(systemServerPOList.size())
|
|
|
- .memoryUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getMemoryUsage() * po.getMemoryTotal() / memorySum).sum() + "%")
|
|
|
- .diskUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getDiskUsage() * po.getDiskTotal() / diskSum).sum() + "%")
|
|
|
- .cpuUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getCpuUsage() * po.getCpuTotal() / cpuSum).sum() + "%")
|
|
|
- .gpuUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getGpuUsage() * po.getGpuTotal() / gpuSum).sum() + "%")
|
|
|
+ .memoryUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getMemoryUsage() * po.getMemoryTotal() * 1.0 / memorySum).sum() + "%")
|
|
|
+ .diskUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getDiskUsage() * po.getDiskTotal() * 1.0 / diskSum).sum() + "%")
|
|
|
+ .cpuUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getCpuUsage() * po.getCpuTotal() * 1.0 / cpuSum).sum() + "%")
|
|
|
+ .gpuUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getGpuUsage() * po.getGpuTotal() * 1.0 / gpuSum).sum() + "%")
|
|
|
.build();
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, build);
|
|
|
}
|
|
@@ -99,8 +99,8 @@ public class HomePageService {
|
|
|
}
|
|
|
|
|
|
public List<LineChartVO> selectRunTaskChart() {
|
|
|
- Map<String,String> param = new HashMap();
|
|
|
- param.put("dateBegin",TimeUtil.getMinusDaysStr(6));
|
|
|
+ Map<String, String> param = new HashMap();
|
|
|
+ param.put("dateBegin", TimeUtil.getMinusDaysStr(6));
|
|
|
param.put("createUserId", AuthUtil.getCurrentUserId());
|
|
|
List<LineChartVO> listVo = homePageMapper.selectRunTaskChart(param);
|
|
|
List<LineChartVO> list = makeLineChartDate(listVo, 6);
|
|
@@ -108,8 +108,8 @@ public class HomePageService {
|
|
|
}
|
|
|
|
|
|
public List<LineChartVO> selectRunProjectChart() {
|
|
|
- Map<String,String> param = new HashMap();
|
|
|
- param.put("dateBegin",TimeUtil.getMinusDaysStr(6));
|
|
|
+ Map<String, String> param = new HashMap();
|
|
|
+ param.put("dateBegin", TimeUtil.getMinusDaysStr(6));
|
|
|
param.put("createUserId", AuthUtil.getCurrentUserId());
|
|
|
List<LineChartVO> listVo = homePageMapper.selectRunProjectChart(param);
|
|
|
List<LineChartVO> list = makeLineChartDate(listVo, 6);
|
|
@@ -124,9 +124,9 @@ public class HomePageService {
|
|
|
boolean notNull = ObjectUtil.isNotNull(listVo);
|
|
|
for (int i = j; i >= 0; i--) {
|
|
|
String date = TimeUtil.getMinusDaysStr(i);
|
|
|
- if(notNull){
|
|
|
+ if (notNull) {
|
|
|
List<LineChartVO> collect = listVo.stream().filter(v -> date.equals(v.getToDate())).collect(Collectors.toList());
|
|
|
- if(ObjectUtil.isNotNull(collect)){
|
|
|
+ if (ObjectUtil.isNotNull(collect)) {
|
|
|
LineChartVO vo = collect.get(0);
|
|
|
list.add(vo);
|
|
|
continue;
|