diff --git a/src/main/java/com/nhn/pinpoint/web/applicationmap/Application.java b/src/main/java/com/nhn/pinpoint/web/applicationmap/Application.java index 3293c2cf1..9ca0abc28 100644 --- a/src/main/java/com/nhn/pinpoint/web/applicationmap/Application.java +++ b/src/main/java/com/nhn/pinpoint/web/applicationmap/Application.java @@ -47,24 +47,30 @@ public class Application implements Comparable, Mergeable hostHistogram) { if (hostHistogram == null) { return; } for (Entry entry : hostHistogram.entrySet()) { - String name = entry.getKey(); + String instanceName = entry.getKey(); + int pos = instanceName.indexOf(':'); + String hostName = (pos > 0) ? instanceName.substring(0, pos) : instanceName; ServiceType serviceType = entry.getValue().getServiceType(); - MergeableMap serverInstanceMap = serverInstanceList.get(name); - - ServerInstance serverInstance = new ServerInstance(name, serviceType, null); + ServerInstance serverInstance = new ServerInstance(instanceName, serviceType, null); + MergeableMap serverInstanceMap = serverInstanceList.get(hostName); if (serverInstanceMap == null) { MergeableMap value = new MergeableTreeMap(); value.put(serverInstance.getId(), serverInstance); - serverInstanceList.put(name, value); + serverInstanceList.put(hostName, value); } else { - MergeableMap map = serverInstanceList.get(name); + MergeableMap map = serverInstanceList.get(hostName); map.putOrMerge(serverInstance.getId(), serverInstance); } }