提交 9987f5f7 编写于 作者: P pengys5

Fixed #418, move the operation which create instances json array outside of for each function.

上级 e2e991d8
......@@ -28,11 +28,12 @@ public class InstanceHealthService {
IInstanceDAO instanceDAO = (IInstanceDAO)DAOContainer.INSTANCE.get(IInstanceDAO.class.getName());
List<InstanceDataDefine.Instance> 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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册