mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-16 08:16:15 +10:00
@@ -384,6 +384,9 @@ public class ApplicationMapBuilder {
|
||||
} else if (nodeServiceType.isWas()) {
|
||||
Set<AgentInfoBo> agentList = agentInfoService.selectAgent(node.getApplication().getName(), range);
|
||||
if (agentList.isEmpty()) {
|
||||
logger.warn("agentInfo not found. applicationName:{}", node.getApplication());
|
||||
// avoid NPE
|
||||
node.setServerInstanceList(new ServerInstanceList());
|
||||
return;
|
||||
}
|
||||
logger.debug("add agentInfo. {}, {}", node.getApplication(), agentList);
|
||||
|
||||
@@ -43,8 +43,8 @@ public class Node {
|
||||
public static final String NODE_DELIMITER = "^";
|
||||
|
||||
private final Application application;
|
||||
|
||||
private ServerInstanceList serverInstanceList;
|
||||
// avoid NPE
|
||||
private ServerInstanceList serverInstanceList = new ServerInstanceList();
|
||||
|
||||
private NodeHistogram nodeHistogram;
|
||||
|
||||
@@ -74,8 +74,11 @@ public class Node {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO remove setter
|
||||
public void setServerInstanceList(ServerInstanceList serverInstanceList) {
|
||||
if (serverInstanceList == null) {
|
||||
throw new NullPointerException("serverInstanceList must not be null");
|
||||
}
|
||||
this.serverInstanceList = serverInstanceList;
|
||||
}
|
||||
|
||||
|
||||
+15
-5
@@ -16,12 +16,9 @@
|
||||
|
||||
package com.navercorp.pinpoint.web.applicationmap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.*;
|
||||
|
||||
import com.navercorp.pinpoint.common.bo.AgentInfoBo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -58,6 +55,19 @@ public class ServerInstanceList {
|
||||
return serverInstanceList;
|
||||
}
|
||||
|
||||
public List<String> getAgentIdList() {
|
||||
final Collection<List<ServerInstance>> serverInstanceValueList = this.serverInstanceList.values();
|
||||
|
||||
final List<String> agentList = new ArrayList<String>();
|
||||
for (List<ServerInstance> serverInstanceList : serverInstanceValueList) {
|
||||
for (ServerInstance serverInstance : serverInstanceList) {
|
||||
AgentInfoBo agentInfo = serverInstance.getAgentInfo();
|
||||
agentList.add(agentInfo.getAgentId());
|
||||
}
|
||||
}
|
||||
return agentList;
|
||||
}
|
||||
|
||||
public int getInstanceCount() {
|
||||
int count = 0;
|
||||
for (List<ServerInstance> entry : serverInstanceList.values()) {
|
||||
|
||||
+1
@@ -178,6 +178,7 @@ public class BusinessTransactionController {
|
||||
|
||||
|
||||
if (viewVersion == 2) {
|
||||
// TODO remove hashformat
|
||||
mv.setViewName("transactionInfoJsonHash");
|
||||
} else {
|
||||
mv.setViewName("transactionInfoJson");
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.navercorp.pinpoint.web.view;
|
||||
|
||||
import com.navercorp.pinpoint.web.applicationmap.Link;
|
||||
import com.navercorp.pinpoint.web.applicationmap.Node;
|
||||
import com.navercorp.pinpoint.web.applicationmap.ServerInstanceList;
|
||||
import com.navercorp.pinpoint.web.applicationmap.histogram.Histogram;
|
||||
import com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram;
|
||||
import com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList;
|
||||
@@ -45,6 +46,9 @@ public class LinkSerializer extends JsonSerializer<Link> {
|
||||
jgen.writeStringField("from", link.getFrom().getNodeName()); // necessary for go.js
|
||||
jgen.writeStringField("to", link.getTo().getNodeName()); // necessary for go.js
|
||||
|
||||
// for FilterWizard. from, to agent mapping data
|
||||
writeAgentId("fromAgent", link.getFrom(), jgen);
|
||||
writeAgentId("toAgent", link.getTo(), jgen);
|
||||
|
||||
writeSimpleNode("sourceInfo", link.getFrom(), jgen);
|
||||
writeSimpleNode("targetInfo", link.getTo(), jgen);
|
||||
@@ -79,6 +83,20 @@ public class LinkSerializer extends JsonSerializer<Link> {
|
||||
jgen.writeEndObject();
|
||||
}
|
||||
|
||||
private void writeAgentId(String fieldName, Node node, JsonGenerator jgen) throws IOException {
|
||||
if (node.getServiceType().isWas()) {
|
||||
jgen.writeFieldName(fieldName);
|
||||
jgen.writeStartArray();
|
||||
ServerInstanceList serverInstanceList = node.getServerInstanceList();
|
||||
if (serverInstanceList!= null) {
|
||||
for (String agentId : serverInstanceList.getAgentIdList()) {
|
||||
jgen.writeObject(agentId);
|
||||
}
|
||||
}
|
||||
jgen.writeEndArray();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeWasToWasTargetRpcList(Link link, JsonGenerator jgen) throws IOException {
|
||||
// write additional information to be used for filtering failed WAS -> WAS call events.
|
||||
jgen.writeFieldName("filterTargetRpcList");
|
||||
|
||||
Reference in New Issue
Block a user