use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.
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 NodeHistogramAppenderTest method createLinkCallDataMap.
private LinkCallDataMap createLinkCallDataMap(String fromAgentId, ServiceType fromAgentServiceType, String toAgentId, ServiceType toAgentServiceType, HistogramSlot slot, long callCount) {
long currentTimestamp = System.currentTimeMillis();
LinkCallDataMap linkCallDataMap = new LinkCallDataMap();
linkCallDataMap.addCallData(fromAgentId, fromAgentServiceType, toAgentId, toAgentServiceType, currentTimestamp, slot.getSlotTime(), callCount);
return linkCallDataMap;
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.
the class MapStatisticsCallerDataCollector method collect.
@Override
public void collect() {
if (init.get()) {
return;
}
LinkDataMap callerDataMap = mapStatisticsCallerDao.selectCaller(application, Range.newRange(timeSlotEndTime - slotInterval, timeSlotEndTime));
for (LinkData linkData : callerDataMap.getLinkDataList()) {
LinkCallDataMap linkCallDataMap = linkData.getLinkCallDataMap();
for (LinkCallData linkCallData : linkCallDataMap.getLinkDataList()) {
calleeStatMap.put(linkCallData.getTarget(), linkCallData);
}
}
init.set(true);
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.
the class ApplicationMapBuilder method createTerminalNodeHistogram.
private NodeHistogram createTerminalNodeHistogram(Node node, LinkList linkList) {
// for Terminal nodes, add all links pointing to iself and create the histogram
final Application nodeApplication = node.getApplication();
final NodeHistogram nodeHistogram = new NodeHistogram(nodeApplication, range);
// create applicationHistogram
final List<Link> toLinkList = linkList.findToLink(nodeApplication);
final Histogram applicationHistogram = new Histogram(node.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(nodeApplication, range);
ApplicationTimeHistogram applicationTimeHistogram = builder.build(linkCallDataMap.getLinkDataList());
nodeHistogram.setApplicationTimeHistogram(applicationTimeHistogram);
// for Terminal nodes, create AgentLevel histogram
if (nodeApplication.getServiceType().isTerminal() || nodeApplication.getServiceType().isQueue()) {
final Map<String, Histogram> agentHistogramMap = new HashMap<>();
for (Link link : toLinkList) {
LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
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);
}
}
LinkCallDataMap mergeSource = new LinkCallDataMap();
for (Link link : toLinkList) {
LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
mergeSource.addLinkDataMap(sourceLinkCallDataMap);
}
AgentTimeHistogramBuilder agentTimeBuilder = new AgentTimeHistogramBuilder(nodeApplication, 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 MapStatisticsCallerDataCollector method collect.
@Override
public void collect() {
if (init.get()) {
return;
}
LinkDataMap callerDataMap = mapStatisticsCallerDao.selectCaller(application, new Range(timeSlotEndTime - slotInterval, timeSlotEndTime));
for (LinkData linkData : callerDataMap.getLinkDataList()) {
LinkCallDataMap linkCallDataMap = linkData.getLinkCallDataMap();
for (LinkCallData linkCallData : linkCallDataMap.getLinkDataList()) {
calleStatMap.put(linkCallData.getTarget(), linkCallData);
}
}
init.set(true);
}
Aggregations