Search in sources :

Example 1 with LinkData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData 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 LinkData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.

the class ApplicationMapBuilder method createSourceLink.

private void createSourceLink(NodeList nodeList, LinkList linkList, LinkDataMap linkDataMap) {
    for (LinkData linkData : linkDataMap.getLinkDataList()) {
        final Application fromApplicationId = linkData.getFromApplication();
        Node fromNode = nodeList.findNode(fromApplicationId);
        final Application toApplicationId = linkData.getToApplication();
        Node toNode = nodeList.findNode(toApplicationId);
        // rpc client missing
        if (toNode == null) {
            logger.warn("toNode rcp client not found:{}", toApplicationId);
            continue;
        }
        // shouldn't really be necessary as rpc client toNodes are converted to unknown nodes beforehand.
        if (toNode.getServiceType().isRpcClient()) {
            if (!nodeList.containsNode(toNode.getApplication())) {
                final Link link = addLink(linkList, fromNode, toNode, CreateType.Source);
                if (link != null) {
                    logger.debug("createRpcSourceLink:{}", link);
                }
            }
        } else {
            final Link link = addLink(linkList, fromNode, toNode, CreateType.Source);
            if (link != null) {
                logger.debug("createSourceLink:{}", link);
            }
        }
    }
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) Application(com.navercorp.pinpoint.web.vo.Application)

Example 3 with LinkData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.

the class ApplicationMapBuilder method createNode.

private void createNode(NodeList nodeList, LinkDataMap linkDataMap) {
    for (LinkData linkData : linkDataMap.getLinkDataList()) {
        final Application fromApplication = linkData.getFromApplication();
        // cannot be RPC. Already converted to unknown.
        if (!fromApplication.getServiceType().isRpcClient()) {
            final boolean success = addNode(nodeList, fromApplication);
            if (success) {
                logger.debug("createSourceNode:{}", fromApplication);
            }
        } else {
            logger.warn("found rpc fromNode linkData:{}", linkData);
        }
        final Application toApplication = linkData.getToApplication();
        // FROM -> TO : TO is either a CLIENT or a node
        if (!toApplication.getServiceType().isRpcClient()) {
            final boolean success = addNode(nodeList, toApplication);
            if (success) {
                logger.debug("createTargetNode:{}", toApplication);
            }
        } else {
            logger.warn("found rpc toNode:{}", linkData);
        }
    }
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) Application(com.navercorp.pinpoint.web.vo.Application)

Example 4 with LinkData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.

the class ApplicationMapBuilder method createTargetLink.

private void createTargetLink(NodeList nodeList, LinkList linkList, LinkDataMap linkDataMap) {
    for (LinkData linkData : linkDataMap.getLinkDataList()) {
        final Application fromApplicationId = linkData.getFromApplication();
        Node fromNode = nodeList.findNode(fromApplicationId);
        final Application toApplicationId = linkData.getToApplication();
        Node toNode = nodeList.findNode(toApplicationId);
        // rpc client missing
        if (fromNode == null) {
            logger.warn("fromNode rcp client not found:{}", toApplicationId);
            continue;
        }
        // for RPC clients: skip if there is a dest application, convert to "unknown cloud" if not
        if (toNode.getServiceType().isRpcClient()) {
            // check if "to" node exists
            if (!nodeList.containsNode(toNode.getApplication())) {
                final Link link = addLink(linkList, fromNode, toNode, CreateType.Target);
                if (link != null) {
                    logger.debug("createRpcTargetLink:{}", link);
                }
            }
        } else {
            final Link link = addLink(linkList, fromNode, toNode, CreateType.Target);
            if (link != null) {
                logger.debug("createTargetLink:{}", link);
            }
        }
    }
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) Application(com.navercorp.pinpoint.web.vo.Application)

Example 5 with LinkData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData 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

LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)5 Application (com.navercorp.pinpoint.web.vo.Application)3 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)1 LinkCallDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap)1 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)1 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)1 Range (com.navercorp.pinpoint.web.vo.Range)1