Search in sources :

Example 21 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class BFSLinkSelector method checkRpcCallAccepted.

private List<LinkData> checkRpcCallAccepted(LinkData linkData, Range range) {
    // replace if the rpc client's destination has an agent installed and thus has an application name
    final Application toApplication = linkData.getToApplication();
    if (!toApplication.getServiceType().isRpcClient() && !toApplication.getServiceType().isQueue()) {
        return Collections.singletonList(linkData);
    }
    logger.debug("checkRpcCallAccepted(). Find applicationName:{} {}", toApplication, range);
    final Set<AcceptApplication> acceptApplicationList = findAcceptApplication(linkData.getFromApplication(), toApplication.getName(), range);
    logger.debug("find accept application:{}", acceptApplicationList);
    if (CollectionUtils.isNotEmpty(acceptApplicationList)) {
        if (acceptApplicationList.size() == 1) {
            logger.debug("Application info replaced. {} => {}", linkData, acceptApplicationList);
            AcceptApplication first = acceptApplicationList.iterator().next();
            final LinkData acceptedLinkData = new LinkData(linkData.getFromApplication(), first.getApplication());
            acceptedLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
            return Collections.singletonList(acceptedLinkData);
        } else {
            // special case - there are more than 2 nodes grouped by a single url
            return createVirtualLinkData(linkData, toApplication, acceptApplicationList);
        }
    } else {
        // for queues, accept application may not exist if no consumers have an agent installed
        if (toApplication.getServiceType().isQueue()) {
            return Collections.singletonList(linkData);
        } else {
            final Application unknown = new Application(toApplication.getName(), ServiceType.UNKNOWN);
            final LinkData unknownLinkData = new LinkData(linkData.getFromApplication(), unknown);
            unknownLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
            return Collections.singletonList(unknownLinkData);
        }
    }
}
Also used : AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication) RpcApplication(com.navercorp.pinpoint.web.service.map.RpcApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication)

Example 22 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class DFSLinkSelector method selectCallee.

/**
     * Queries for all applications(caller) that called calleeApplication
     *
     * @param calleeApplication
     * @param range
     * @return
     */
private LinkDataDuplexMap selectCallee(Application calleeApplication, Range range, SearchDepth searchDepth) {
    // skip if the calleeApplication has already been checked
    if (linkVisitChecker.visitCallee(calleeApplication)) {
        return new LinkDataDuplexMap();
    }
    final LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(calleeApplication, range);
    logger.debug("Found Callee. count={}, callee={}", callee.size(), calleeApplication);
    final LinkDataDuplexMap calleeSet = new LinkDataDuplexMap();
    for (LinkData stat : callee.getLinkDataList()) {
        calleeSet.addTargetLinkData(stat);
        // search depth check
        final SearchDepth nextLevel = searchDepth.nextDepth();
        if (nextLevel.isDepthOverflow()) {
            continue;
        }
        // need to find the applications that called me
        LinkDataDuplexMap calleeSub = selectCallee(stat.getFromApplication(), range, nextLevel);
        calleeSet.addLinkDataDuplexMap(calleeSub);
        // find all callees of queried subCallees as well
        for (LinkData eachCallee : calleeSub.getTargetLinkDataList()) {
            // skip if terminal node
            final Application eachCalleeToApplication = eachCallee.getToApplication();
            if (eachCalleeToApplication.getServiceType().isTerminal() || eachCalleeToApplication.getServiceType().isUnknown()) {
                continue;
            }
            LinkDataDuplexMap callerSub = selectCaller(eachCalleeToApplication, range, nextLevel);
            calleeSet.addLinkDataDuplexMap(callerSub);
        }
    }
    return calleeSet;
}
Also used : RpcApplication(com.navercorp.pinpoint.web.service.map.RpcApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication)

Example 23 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class DFSLinkSelector method checkRpcCallAccepted.

private List<LinkData> checkRpcCallAccepted(LinkData linkData, Range range) {
    // replace if the rpc client's destination has an agent installed and thus has an application name
    final Application toApplication = linkData.getToApplication();
    if (!toApplication.getServiceType().isRpcClient()) {
        return Collections.singletonList(linkData);
    }
    logger.debug("checkRpcCallAccepted(). Find applicationName:{} {}", toApplication, range);
    final Set<AcceptApplication> acceptApplicationList = findAcceptApplication(linkData.getFromApplication(), toApplication.getName(), range);
    logger.debug("find accept application:{}", acceptApplicationList);
    if (CollectionUtils.isNotEmpty(acceptApplicationList)) {
        if (acceptApplicationList.size() == 1) {
            logger.debug("Application info replaced. {} => {}", linkData, acceptApplicationList);
            AcceptApplication first = acceptApplicationList.iterator().next();
            final LinkData acceptedLinkData = new LinkData(linkData.getFromApplication(), first.getApplication());
            acceptedLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
            return Collections.singletonList(acceptedLinkData);
        } else {
            // special case - there are more than 2 nodes grouped by a single url
            return createVirtualLinkData(linkData, toApplication, acceptApplicationList);
        }
    } else {
        final Application unknown = new Application(toApplication.getName(), ServiceType.UNKNOWN);
        final LinkData unknownLinkData = new LinkData(linkData.getFromApplication(), unknown);
        unknownLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
        return Collections.singletonList(unknownLinkData);
    }
}
Also used : AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication) RpcApplication(com.navercorp.pinpoint.web.service.map.RpcApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication)

Example 24 with Application

use of com.navercorp.pinpoint.web.vo.Application 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 25 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class DFSLinkSelector method selectCaller.

/**
     * Queries for all applications(callee) called by the callerApplication
     *
     * @param callerApplication
     * @param range
     * @return
     */
private LinkDataDuplexMap selectCaller(Application callerApplication, Range range, SearchDepth searchDepth) {
    // skip if the callerApplication has already been checked
    if (linkVisitChecker.visitCaller(callerApplication)) {
        return new LinkDataDuplexMap();
    }
    LinkDataMap caller = mapStatisticsCallerDao.selectCaller(callerApplication, range);
    if (logger.isDebugEnabled()) {
        logger.debug("Found Caller. count={}, caller={}", caller.size(), callerApplication);
    }
    final LinkDataMap replaceRpcCaller = new LinkDataMap();
    for (LinkData callerLink : caller.getLinkDataList()) {
        final List<LinkData> checkedLink = checkRpcCallAccepted(callerLink, range);
        for (LinkData linkData : checkedLink) {
            replaceRpcCaller.addLinkData(linkData);
        }
    }
    final LinkDataDuplexMap resultCaller = new LinkDataDuplexMap();
    for (LinkData link : replaceRpcCaller.getLinkDataList()) {
        resultCaller.addSourceLinkData(link);
        final Application toApplication = link.getToApplication();
        // skip if toApplication is a terminal or an unknown cloud
        if (toApplication.getServiceType().isTerminal() || toApplication.getServiceType().isUnknown()) {
            continue;
        }
        // search depth check
        final SearchDepth nextLevel = searchDepth.nextDepth();
        if (nextLevel.isDepthOverflow()) {
            continue;
        }
        logger.debug("     Find subCaller of {}", toApplication);
        LinkDataDuplexMap callerSub = selectCaller(toApplication, range, nextLevel);
        logger.debug("     Found subCaller. count={}, caller={}", callerSub.size(), toApplication);
        resultCaller.addLinkDataDuplexMap(callerSub);
        // find all callers of queried subCallers as well
        for (LinkData eachCaller : callerSub.getSourceLinkDataList()) {
            logger.debug("     Find callee of {}", eachCaller.getFromApplication());
            LinkDataDuplexMap calleeSub = selectCallee(eachCaller.getFromApplication(), range, nextLevel);
            logger.debug("     Found subCallee. count={}, callee={}", calleeSub.size(), eachCaller.getFromApplication());
            resultCaller.addLinkDataDuplexMap(calleeSub);
        }
    }
    return resultCaller;
}
Also used : RpcApplication(com.navercorp.pinpoint.web.service.map.RpcApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication)

Aggregations

Application (com.navercorp.pinpoint.web.vo.Application)90 Test (org.junit.Test)39 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)30 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)11 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)10 Range (com.navercorp.pinpoint.web.vo.Range)10 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 List (java.util.List)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)4 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)4 ArrayList (java.util.ArrayList)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)3 ErrorCountToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker)3 ErrorRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker)3