Search in sources :

Example 6 with TimeHistogram

use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram 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 7 with TimeHistogram

use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram 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)

Example 8 with TimeHistogram

use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.

the class ResponseTime method getHistogram.

private Histogram getHistogram(String agentId) {
    if (agentId == null) {
        throw new NullPointerException("agentId must not be null");
    }
    TimeHistogram histogram = responseHistogramMap.get(agentId);
    if (histogram == null) {
        histogram = new TimeHistogram(applicationServiceType, timeStamp);
        responseHistogramMap.put(agentId, histogram);
    }
    return histogram;
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)

Example 9 with TimeHistogram

use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.

the class MapStatisticsCallerDataCollector method getCount.

public long getCount(String calleName, DataCategory dataCategory) {
    LinkCallData linkCallData = calleStatMap.get(calleName);
    long count = 0;
    if (linkCallData != null) {
        switch(dataCategory) {
            case SLOW_COUNT:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getSlowCount();
                    count += timeHistogram.getVerySlowCount();
                }
                break;
            case ERROR_COUNT:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getTotalErrorCount();
                }
                break;
            case TOTAL_COUNT:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getTotalCount();
                }
                break;
            default:
                throw new IllegalArgumentException("Can't count for " + dataCategory.toString());
        }
        return count;
    }
    return 0;
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)

Example 10 with TimeHistogram

use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.

the class MapStatisticsCallerDataCollector method getCountRate.

public long getCountRate(String calleName, DataCategory dataCategory) {
    LinkCallData linkCallData = calleStatMap.get(calleName);
    long count = 0;
    long totalCount = 0;
    if (linkCallData != null) {
        switch(dataCategory) {
            case SLOW_RATE:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getSlowCount();
                    count += timeHistogram.getVerySlowCount();
                    totalCount += timeHistogram.getTotalCount();
                }
                break;
            case ERROR_RATE:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getTotalErrorCount();
                    totalCount += timeHistogram.getTotalCount();
                }
                break;
            default:
                throw new IllegalArgumentException("Can't calculate rate for " + dataCategory.toString());
        }
        return calculatePercent(count, totalCount);
    }
    return 0;
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)

Aggregations

TimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)13 Application (com.navercorp.pinpoint.web.vo.Application)3 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)2 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)2 Test (org.junit.Test)2 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)1 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)1 HashMap (java.util.HashMap)1