Search in sources :

Example 46 with Application

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

the class ApplicationScatterScanResultSerializer method serialize.

@Override
public void serialize(ApplicationScatterScanResult value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
    jgen.writeStartObject();
    Application application = value.getApplication();
    jgen.writeStringField("applicationName", application.getName());
    jgen.writeNumberField("applicationServiceType", application.getServiceTypeCode());
    jgen.writeFieldName("scatter");
    jgen.writeObject(value.getScatterScanResult());
    jgen.writeEndObject();
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application)

Example 47 with Application

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

the class BFSLinkSelector method checkUnsearchEmulationCalleeNode.

private void checkUnsearchEmulationCalleeNode(LinkDataDuplexMap searchResult, Range range) {
    List<Application> unvisitedList = getUnvisitedEmulationNode();
    if (unvisitedList.isEmpty()) {
        logger.debug("unvisited callee node not found");
        return;
    }
    logger.info("unvisited callee node {}", unvisitedList);
    final LinkDataMap calleeLinkData = new LinkDataMap();
    for (Application application : unvisitedList) {
        LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(application, range);
        logger.debug("calleeNode:{}", callee);
        calleeLinkData.addLinkDataMap(callee);
    }
    LinkDataMap unvisitedNodeFilter = new LinkDataMap();
    for (LinkData linkData : calleeLinkData.getLinkDataList()) {
        Application fromApplication = linkData.getFromApplication();
        if (!fromApplication.getServiceType().isWas()) {
            continue;
        }
        Application emulatedApplication = linkData.getToApplication();
        boolean unvisitedNode = isUnVisitedNode(unvisitedList, emulatedApplication, fromApplication);
        if (unvisitedNode) {
            logger.debug("EmulationCalleeNode:{}", linkData);
            unvisitedNodeFilter.addLinkData(linkData);
        }
    }
    logger.debug("UnVisitedNode:{}", unvisitedNodeFilter);
    for (LinkData linkData : unvisitedNodeFilter.getLinkDataList()) {
        searchResult.addTargetLinkData(linkData);
    }
}
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 48 with Application

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

the class BFSLinkSelector 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 49 with Application

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

the class BFSLinkSelector method selectLink.

/**
     * Queries for all applications(caller&callee) called by the targetApplicationList
     *
     * @param targetApplicationList
     * @param range
     * @return
     */
private LinkDataDuplexMap selectLink(List<Application> targetApplicationList, Range range, SearchDepth callerDepth, SearchDepth calleeDepth) {
    final LinkDataDuplexMap searchResult = new LinkDataDuplexMap();
    for (Application targetApplication : targetApplicationList) {
        final boolean searchCallerNode = checkNextCaller(targetApplication, callerDepth);
        if (searchCallerNode) {
            final LinkDataMap caller = mapStatisticsCallerDao.selectCaller(targetApplication, range);
            if (logger.isDebugEnabled()) {
                logger.debug("Found Caller. count={}, caller={}, depth={}", caller.size(), targetApplication, callerDepth.getDepth());
            }
            final LinkDataMap replaceRpcCaller = replaceRpcCaller(caller, range);
            for (LinkData link : replaceRpcCaller.getLinkDataList()) {
                searchResult.addSourceLinkData(link);
                final Application toApplication = link.getToApplication();
                // skip if nextApplication is a terminal or an unknown cloud
                if (toApplication.getServiceType().isTerminal() || toApplication.getServiceType().isUnknown()) {
                    continue;
                }
                addNextNode(toApplication);
            }
        }
        final boolean searchCalleeNode = checkNextCallee(targetApplication, calleeDepth);
        if (searchCalleeNode) {
            final LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(targetApplication, range);
            if (logger.isInfoEnabled()) {
                logger.debug("Found Callee. count={}, callee={}, depth={}", callee.size(), targetApplication, calleeDepth.getDepth());
            }
            for (LinkData stat : callee.getLinkDataList()) {
                searchResult.addTargetLinkData(stat);
                final Application fromApplication = stat.getFromApplication();
                addNextNode(fromApplication);
            }
        }
    }
    logger.debug("{} depth search end", callerDepth.getDepth());
    return searchResult;
}
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 50 with Application

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

the class BFSLinkSelector method fillEmulationLink.

private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap, Range range) {
    // 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) {
            // This is a case where the emulation target node has been only "partially" visited, (ie. does not have a target link data)
            // Most likely due to the limit imposed by inbound search depth.
            // Must go fetch the target link data here.
            final Application targetApplication = emulationLinkData.getToApplication();
            final LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(targetApplication, range);
            targetLinkData = callee.getLinkData(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) RpcApplication(com.navercorp.pinpoint.web.service.map.RpcApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication) TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)

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