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

develop
bayuzhen 2024-05-30 15:00:24 +08:00
parent 052f62aba2
commit 62b373324d
1 changed files with 4 additions and 1 deletions

View File

@ -105,7 +105,10 @@ public class ResourceScreenServiceImpl implements ResourceScreenService {
long cpuTotal = 0L; long cpuTotal = 0L;
Long memTotal = 0L; Long memTotal = 0L;
int diskTotal = 0; int diskTotal = 0;
List<Server> hosts = imsInternalService.listHosts(); List<Server> hostAll = imsInternalService.listHosts();
List<Server> hosts = hostAll.stream().filter(
server -> null != server.getVendorType() && vendors.contains(server.getVendorType()))
.collect(Collectors.toList());
hosts.removeIf(server -> null == server.getVendorId()); hosts.removeIf(server -> null == server.getVendorId());
Map<Long, List<Server>> hostMap = hosts.stream().filter(server -> null != server.getVendorId()) Map<Long, List<Server>> hostMap = hosts.stream().filter(server -> null != server.getVendorId())
.collect(Collectors.groupingBy(Server::getVendorId)); .collect(Collectors.groupingBy(Server::getVendorId));