Repository: pinpoint-apm/pinpoint
Issue: Avoid serializing detailed agent information when rendering server map
Labels: enhancement

The server map does not use any of the detailed agent information such as those shown in the Inspector view. Removing them would abolish unnecessary overhead (although minute) as these information can be quite large.

Note that this has already been applied in 1.5.0 through #926 


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstance.java b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstance.java
index 4f105fc19ee3..d1e41ce25d4d 100644
--- a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstance.java
+++ b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstance.java
@@ -37,9 +37,6 @@ public class ServerInstance {
 
     private final ServerType serverType;
 
-    private final AgentInfoBo agentInfo;
-
-
     // it is better for something else to inject this.
     // it's difficult to do that since it is new'ed within logic
     private static final MatcherGroup MATCHER_GROUP = new MatcherGroup();
@@ -53,7 +50,6 @@ public ServerInstance(AgentInfoBo agentInfo) {
         this.hostName = agentInfo.getHostName();
         this.name = agentInfo.getAgentId();
         this.serviceType = agentInfo.getServiceType();
-        this.agentInfo = agentInfo;
         this.serverType = ServerType.Physical;
         this.match = MATCHER_GROUP.match(hostName);
     }
@@ -71,7 +67,6 @@ public ServerInstance(String hostName, String physicalName, ServiceType serviceT
         this.hostName = hostName;
         this.name = physicalName;
         this.serviceType = serviceType;
-        this.agentInfo = null;
         this.serverType = ServerType.Logical;
         this.match = MATCHER_GROUP.match(hostName);
     }
@@ -96,11 +91,6 @@ public ServerType getServerType() {
         return serverType;
     }
 
-    @JsonProperty("agentInfo")
-    public AgentInfoBo getAgentInfo() {
-        return agentInfo;
-    }
-
     @JsonProperty("linkName")
     public String getLinkName() {
         return match.getLinkName();
@@ -120,7 +110,6 @@ public boolean hasInspector() {
         }
     }
 
-
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
diff --git a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstanceList.java b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstanceList.java
index eb337295f007..2f816f60063a 100644
--- a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstanceList.java
+++ b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ServerInstanceList.java
@@ -18,7 +18,6 @@
 
 import java.util.*;
 
-import com.navercorp.pinpoint.common.bo.AgentInfoBo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,8 +60,7 @@ public List<String> getAgentIdList() {
         final List<String> agentList = new ArrayList<String>();
         for (List<ServerInstance> serverInstanceList : serverInstanceValueList) {
             for (ServerInstance serverInstance : serverInstanceList) {
-                AgentInfoBo agentInfo = serverInstance.getAgentInfo();
-                agentList.add(agentInfo.getAgentId());
+                agentList.add(serverInstance.getName());
             }
         }
         return agentList;


Test patch: