Search in sources :

Example 1 with LinkKey

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

Example 2 with LinkKey

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);
}
Also used : LinkKey(com.navercorp.pinpoint.web.vo.LinkKey) RpcApplication(com.navercorp.pinpoint.web.service.map.RpcApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication)

Example 3 with LinkKey

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

Example 4 with LinkKey

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

Example 5 with LinkKey

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

Aggregations

LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)37 Application (com.navercorp.pinpoint.web.vo.Application)20 Test (org.junit.Test)17 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)16 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)14 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)11 Range (com.navercorp.pinpoint.web.vo.Range)11 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)9 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)7 VirtualLinkMarker (com.navercorp.pinpoint.web.service.map.VirtualLinkMarker)6 TimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)3 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)3 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)2 ArrayList (java.util.ArrayList)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 CreateType (com.navercorp.pinpoint.web.applicationmap.link.CreateType)1 LinkHistogramSummary (com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary)1