Search in sources :

Example 11 with LinkCallDataMap

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);
        }
    }
}
Also used : LinkKey(com.navercorp.pinpoint.web.vo.LinkKey) LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)

Example 12 with LinkCallDataMap

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;
}
Also used : Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) ApplicationTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) Link(com.navercorp.pinpoint.web.applicationmap.link.Link)

Example 13 with LinkCallDataMap

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;
}
Also used : AgentTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogramBuilder) Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) ApplicationTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder) HashMap(java.util.HashMap) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) AgentHistogramList(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList) Link(com.navercorp.pinpoint.web.applicationmap.link.Link)

Example 14 with LinkCallDataMap

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());
}
Also used : LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) AgentHistogramList(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)

Aggregations

LinkCallDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap)14 AgentTimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram)5 ApplicationTimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram)5 ApplicationTimeHistogramBuilder (com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder)5 Histogram (com.navercorp.pinpoint.web.applicationmap.histogram.Histogram)5 NodeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram)5 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)5 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)5 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)5 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)4 AgentTimeHistogramBuilder (com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogramBuilder)3 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)3 HashMap (java.util.HashMap)3 TimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)2 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)2 Application (com.navercorp.pinpoint.web.vo.Application)1 Range (com.navercorp.pinpoint.web.vo.Range)1