Search in sources :

Example 1 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 2 with TimeHistogram

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

the class LinkCallData method addCallData.

public void addCallData(Collection<TimeHistogram> timeHistogramList) {
    for (TimeHistogram timeHistogram : timeHistogramList) {
        TimeHistogram histogram = getTimeHistogram(timeHistogram.getTimeStamp());
        histogram.add(timeHistogram);
    }
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)

Example 3 with TimeHistogram

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

the class LinkCallData method getTimeHistogram.

private TimeHistogram getTimeHistogram(Long timeStamp) {
    long key = timeWindow != null ? timeWindow.refineTimestamp(timeStamp) : timeStamp;
    TimeHistogram histogram = targetHistogramTimeMap.get(key);
    if (histogram == null) {
        histogram = new TimeHistogram(targetServiceType, key);
        targetHistogramTimeMap.put(key, histogram);
    }
    return histogram;
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)

Example 4 with TimeHistogram

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

the class LinkCallData method addRawCallData.

public void addRawCallData(LinkCallData copyLinkCallData) {
    Objects.requireNonNull(copyLinkCallData, "copyLinkCallData");
    if (!this.source.equals(copyLinkCallData.source)) {
        throw new IllegalArgumentException("source not equals");
    }
    if (this.sourceServiceType != copyLinkCallData.sourceServiceType) {
        throw new IllegalArgumentException("sourceServiceType not equals");
    }
    if (!this.target.equals(copyLinkCallData.target)) {
        throw new IllegalArgumentException("target not equals");
    }
    if (this.targetServiceType != copyLinkCallData.targetServiceType) {
        throw new IllegalArgumentException("targetServiceType not equals");
    }
    for (Map.Entry<Long, TimeHistogram> copyEntry : copyLinkCallData.targetHistogramTimeMap.entrySet()) {
        final Long timeStamp = copyEntry.getKey();
        TimeHistogram histogram = getTimeHistogram(timeStamp);
        histogram.add(copyEntry.getValue());
    }
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)

Example 5 with TimeHistogram

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

the class VirtualLinkHandler method fillEmulationLink.

private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap, Set<LinkData> emulationLinkMarker) {
    // 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:{}", emulationLinkMarker);
    List<LinkData> emulationLinkDataList = findEmulationLinkData(linkDataDuplexMap, emulationLinkMarker);
    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) LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) 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)17 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)5 Application (com.navercorp.pinpoint.web.vo.Application)3 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)3 Test (org.junit.Test)2 LinkCallDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap)1 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)1 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)1 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)1 HashMap (java.util.HashMap)1