diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java b/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java index be97060c4099..511381345f19 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java @@ -175,11 +175,13 @@ public AgentsMapByHost getAgentsListByApplicationName(AgentStatusFilter agentSta agentInfoAndStatuses ); - int total = agentsMapByHost.getAgentsListsList() - .stream() - .mapToInt(list -> list.getInstancesList().size()) - .sum(); - logger.debug("getAgentsMapByHostname={} {}", agentsMapByHost, total); + final int totalAgentCount = agentsMapByHost.size(); + if (logger.isInfoEnabled()) { + logger.info("getAgentsMapByHostname size:{}", totalAgentCount); + } + if (logger.isDebugEnabled()) { + logger.debug("getAgentsMapByHostname size:{} data:{}", totalAgentCount, agentsMapByHost); + } return agentsMapByHost; } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/AgentsMapByHost.java b/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/AgentsMapByHost.java index f11266ba07d7..8ccd58c731ed 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/AgentsMapByHost.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/AgentsMapByHost.java @@ -66,6 +66,10 @@ private static AgentStatusAndLink newAgentStatusAndLink(AgentAndStatus agentAndS return new AgentStatusAndLink(agentInfo, status, hyperLinks); } + public int size() { + return instancesListMap.size(); + } + @Override public String toString() { return "AgentsMapByHost{" + diff --git a/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/InstancesListMap.java b/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/InstancesListMap.java index 410075cc7cc0..b14d8b29cd19 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/InstancesListMap.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/vo/tree/InstancesListMap.java @@ -51,10 +51,18 @@ public List> getListMap() { return listMap; } + public int size() { + return listMap.stream() + .map(InstancesList::getInstancesList) + .mapToInt(List::size) + .sum(); + } + @Override public String toString() { return "InstancesListMap{" + "listMap=" + listMap + '}'; } + }