use of com.navercorp.pinpoint.web.vo.LinkKey in project pinpoint by naver.
the class ApplicationMapBuilder method appendLinkHistogram.
private void appendLinkHistogram(Link link, LinkDataDuplexMap linkDataDuplexMap) {
logger.debug("appendLinkHistogram link:{}", link);
LinkKey key = link.getLinkKey();
LinkData sourceLinkData = linkDataDuplexMap.getSourceLinkData(key);
if (sourceLinkData != null) {
link.addSource(sourceLinkData.getLinkCallDataMap());
}
LinkData targetLinkData = linkDataDuplexMap.getTargetLinkData(key);
if (targetLinkData != null) {
link.addTarget(targetLinkData.getLinkCallDataMap());
}
}
use of com.navercorp.pinpoint.web.vo.LinkKey in project pinpoint by naver.
the class DFSLinkSelector method getLinkKey.
private LinkKey getLinkKey(LinkData emulationLinkData) {
Application fromApplication = emulationLinkData.getFromApplication();
Application toApplication = emulationLinkData.getToApplication();
return new LinkKey(fromApplication, toApplication);
}
use of com.navercorp.pinpoint.web.vo.LinkKey in project pinpoint by naver.
the class DFSLinkSelector method fillEmulationLink.
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap) {
// 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:{}", this.emulationLinkMarker);
List<LinkData> emulationLinkDataList = findEmulationLinkData(linkDataDuplexMap);
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.vo.LinkKey in project pinpoint by naver.
the class LinkDataMap method getLinkData.
private LinkData getLinkData(Application fromApplication, Application toApplication) {
final LinkKey key = new LinkKey(fromApplication, toApplication);
LinkData findLink = linkDataMap.computeIfAbsent(key, k -> new LinkData(fromApplication, toApplication, timeWindow));
return findLink;
}
use of com.navercorp.pinpoint.web.vo.LinkKey in project pinpoint by naver.
the class LinkCallDataMap method addCallData.
public void addCallData(String sourceAgentId, ServiceType sourceServiceType, String targetId, ServiceType targetServiceType, Collection<TimeHistogram> timeHistogramList) {
LinkKey linkKey = createLinkKey(sourceAgentId, sourceServiceType, targetId, targetServiceType);
LinkCallData linkCallData = getLinkCallData(linkKey);
linkCallData.addCallData(timeHistogramList);
}
Aggregations