diff --git a/apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/InstanceHealthService.java b/apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/InstanceHealthService.java index a0434ed2a4302e8389214633371ecffbe33831c6..a29e509cc7030a43de412b73be71544e0d485dc5 100644 --- a/apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/InstanceHealthService.java +++ b/apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/InstanceHealthService.java @@ -28,11 +28,12 @@ public class InstanceHealthService { IInstanceDAO instanceDAO = (IInstanceDAO)DAOContainer.INSTANCE.get(IInstanceDAO.class.getName()); List instanceList = instanceDAO.getInstances(applicationId, halfHourBeforeTimeBucket); + JsonArray instances = new JsonArray(); + response.add("instances", instances); + instanceList.forEach(instance -> { - JsonArray instances = new JsonArray(); response.addProperty("applicationCode", ApplicationCache.getForUI(applicationId)); response.addProperty("applicationId", applicationId); - response.add("instances", instances); IInstPerformanceDAO instPerformanceDAO = (IInstPerformanceDAO)DAOContainer.INSTANCE.get(IInstPerformanceDAO.class.getName()); IInstPerformanceDAO.InstPerformance performance = instPerformanceDAO.get(timeBuckets, instance.getInstanceId());