use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by pinpoint-apm.
the class VirtualLinkHandler method fillEmulationLink.
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap, Set<LinkData> emulationLinkMarker) {
// TODO need to be reimplemented - virtual node creation logic needs an overhaul.
// Currently, only the reversed relationship node is displayed. We need to create a virtual node and convert the rpc data appropriately.
logger.debug("this.emulationLinkMarker:{}", emulationLinkMarker);
List<LinkData> emulationLinkDataList = findEmulationLinkData(linkDataDuplexMap, emulationLinkMarker);
for (LinkData emulationLinkData : emulationLinkDataList) {
LinkCallDataMap beforeImage = emulationLinkData.getLinkCallDataMap();
logger.debug("beforeImage:{}", beforeImage);
emulationLinkData.resetLinkData();
LinkKey findLinkKey = new LinkKey(emulationLinkData.getFromApplication(), emulationLinkData.getToApplication());
LinkData targetLinkData = linkDataDuplexMap.getTargetLinkData(findLinkKey);
if (targetLinkData == null) {
// There has been a case where targetLinkData was null, but exact event could not be captured for analysis.
// Logging the case for further analysis should it happen again in the future.
logger.error("targetLinkData not found findLinkKey:{}", findLinkKey);
continue;
}
// create reversed link data - convert data accepted by the target to target's call data
LinkCallDataMap targetList = targetLinkData.getLinkCallDataMap();
Collection<LinkCallData> beforeLinkDataList = beforeImage.getLinkDataList();
LinkCallData beforeLinkCallData = beforeLinkDataList.iterator().next();
for (LinkCallData agentHistogram : targetList.getLinkDataList()) {
Collection<TimeHistogram> timeHistogramList = agentHistogram.getTimeHistogram();
LinkCallDataMap linkCallDataMap = emulationLinkData.getLinkCallDataMap();
if (logger.isDebugEnabled()) {
logger.debug("emulationLink BEFORE:{}", beforeLinkCallData);
logger.debug("emulationLink agent:{}", agentHistogram);
logger.debug("emulationLink link:{}/{} -> {}/{}", agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType().getCode());
}
linkCallDataMap.addCallData(agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType(), timeHistogramList);
}
}
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.
the class DefaultNodeHistogramFactory method createQueueNodeHistogram.
@Override
public NodeHistogram createQueueNodeHistogram(Application queueApplication, Range range, LinkList linkList) {
final List<Link> toLinkList = linkList.findToLink(queueApplication);
if (toLinkList.isEmpty()) {
return new NodeHistogram(queueApplication, range);
}
final NodeHistogram nodeHistogram = new NodeHistogram(queueApplication, range);
// create applicationHistogram
final Histogram applicationHistogram = new Histogram(queueApplication.getServiceType());
for (Link link : toLinkList) {
applicationHistogram.add(link.getHistogram());
}
nodeHistogram.setApplicationHistogram(applicationHistogram);
// create applicationTimeHistogram
LinkCallDataMap linkCallDataMap = new LinkCallDataMap();
for (Link link : toLinkList) {
LinkCallDataMap linkCallDataMapToUse = link.getSourceLinkCallDataMap();
// depending on whether the link has been generated with the queue node as the caller, or the callee.
if (linkCallDataMapToUse.getLinkDataList().isEmpty()) {
linkCallDataMapToUse = link.getTargetLinkCallDataMap();
}
linkCallDataMap.addLinkDataMap(linkCallDataMapToUse);
}
ApplicationTimeHistogramBuilder builder = new ApplicationTimeHistogramBuilder(queueApplication, range);
ApplicationTimeHistogram applicationTimeHistogram = builder.build(linkCallDataMap.getLinkDataList());
nodeHistogram.setApplicationTimeHistogram(applicationTimeHistogram);
return nodeHistogram;
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.
the class DefaultNodeHistogramFactory method createTerminalNodeHistogram.
@Override
public NodeHistogram createTerminalNodeHistogram(Application terminalApplication, Range range, LinkList linkList) {
// for Terminal nodes, add all links pointing to the application and create the histogram
final NodeHistogram nodeHistogram = new NodeHistogram(terminalApplication, range);
// create applicationHistogram
final List<Link> toLinkList = linkList.findToLink(terminalApplication);
final Histogram applicationHistogram = new Histogram(terminalApplication.getServiceType());
for (Link link : toLinkList) {
applicationHistogram.add(link.getHistogram());
}
nodeHistogram.setApplicationHistogram(applicationHistogram);
// create applicationTimeHistogram
LinkCallDataMap linkCallDataMap = new LinkCallDataMap();
for (Link link : toLinkList) {
LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
linkCallDataMap.addLinkDataMap(sourceLinkCallDataMap);
}
ApplicationTimeHistogramBuilder builder = new ApplicationTimeHistogramBuilder(terminalApplication, range);
ApplicationTimeHistogram applicationTimeHistogram = builder.build(linkCallDataMap.getLinkDataList());
nodeHistogram.setApplicationTimeHistogram(applicationTimeHistogram);
// for Terminal nodes, create AgentLevel histogram
if (terminalApplication.getServiceType().isTerminal() || terminalApplication.getServiceType().isAlias()) {
LinkCallDataMap mergeSource = new LinkCallDataMap();
final Map<String, Histogram> agentHistogramMap = new HashMap<>();
for (Link link : toLinkList) {
LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
mergeSource.addLinkDataMap(sourceLinkCallDataMap);
AgentHistogramList targetList = sourceLinkCallDataMap.getTargetList();
for (AgentHistogram histogram : targetList.getAgentHistogramList()) {
Histogram find = agentHistogramMap.get(histogram.getId());
if (find == null) {
find = new Histogram(histogram.getServiceType());
agentHistogramMap.put(histogram.getId(), find);
}
find.add(histogram.getHistogram());
}
nodeHistogram.setAgentHistogramMap(agentHistogramMap);
}
AgentTimeHistogramBuilder agentTimeBuilder = new AgentTimeHistogramBuilder(terminalApplication, range);
AgentTimeHistogram agentTimeHistogram = agentTimeBuilder.buildTarget(mergeSource);
nodeHistogram.setAgentTimeHistogram(agentTimeHistogram);
}
return nodeHistogram;
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.
the class Link method createHistogram0.
private Histogram createHistogram0() {
// need serviceType of target (callee)
// ie. Tomcat -> Arcus: we need arcus type
final LinkCallDataMap findMap = getLinkCallDataMap();
AgentHistogramList targetList = findMap.getTargetList();
return targetList.mergeHistogram(toNode.getServiceType());
}
Aggregations