Search in sources :

Example 1 with LinkCallDataMap

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);
        }
    }
}
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 2 with LinkCallDataMap

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

Example 3 with 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);
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Example 4 with LinkCallDataMap

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

Example 5 with 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, 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);
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) Range(com.navercorp.pinpoint.web.vo.Range) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Aggregations

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