Search in sources :

Example 21 with LinkDataMap

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

the class WasOnlyProcessorTest method shouldFilterLinksToUnknownNodes.

@Test
public void shouldFilterLinksToUnknownNodes() {
    // Given
    Application fromApplication = new Application("WAS", ServiceType.TEST_STAND_ALONE);
    Application toApplication = new Application("UNKNOWN", ServiceType.UNKNOWN);
    LinkData wasToUnknownLinkData = new LinkData(fromApplication, toApplication);
    LinkDataMap linkDataMap = new LinkDataMap();
    linkDataMap.addLinkData(wasToUnknownLinkData);
    // When
    WasOnlyProcessor wasOnlyProcessor = new WasOnlyProcessor();
    LinkDataMap filteredLinkDataMap = wasOnlyProcessor.processLinkDataMap(linkDataMap, testRange);
    // Then
    Assert.assertTrue(filteredLinkDataMap.getLinkDataList().isEmpty());
}
Also used : WasOnlyProcessor(com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor) LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) Application(com.navercorp.pinpoint.web.vo.Application) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap) Test(org.junit.Test)

Example 22 with LinkDataMap

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

the class WasOnlyProcessorTest method shouldNotFilterLinksToQueueNodes.

@Test
public void shouldNotFilterLinksToQueueNodes() {
    // Given
    Application fromApplication = new Application("WAS", ServiceType.TEST_STAND_ALONE);
    Application toApplication = new Application("QUEUE", ServiceTypeFactory.of(8888, "QUEUE", ServiceTypeProperty.QUEUE));
    LinkData wasToQueueLinkData = new LinkData(fromApplication, toApplication);
    LinkDataMap linkDataMap = new LinkDataMap();
    linkDataMap.addLinkData(wasToQueueLinkData);
    // When
    WasOnlyProcessor wasOnlyProcessor = new WasOnlyProcessor();
    LinkDataMap filteredLinkDataMap = wasOnlyProcessor.processLinkDataMap(linkDataMap, testRange);
    // Then
    Assert.assertFalse(filteredLinkDataMap.getLinkDataList().isEmpty());
}
Also used : WasOnlyProcessor(com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor) LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) Application(com.navercorp.pinpoint.web.vo.Application) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap) Test(org.junit.Test)

Example 23 with LinkDataMap

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

the class WasOnlyProcessorTest method shouldNotFilterLinksToWasNodes.

@Test
public void shouldNotFilterLinksToWasNodes() {
    // Given
    Application fromApplication = new Application("WAS_FROM", ServiceType.TEST_STAND_ALONE);
    Application toApplication = new Application("WAS_TO", ServiceType.TEST_STAND_ALONE);
    LinkData wasToWasLinkData = new LinkData(fromApplication, toApplication);
    LinkDataMap linkDataMap = new LinkDataMap();
    linkDataMap.addLinkData(wasToWasLinkData);
    // When
    WasOnlyProcessor wasOnlyProcessor = new WasOnlyProcessor();
    LinkDataMap filteredLinkDataMap = wasOnlyProcessor.processLinkDataMap(linkDataMap, testRange);
    // Then
    Assert.assertFalse(filteredLinkDataMap.getLinkDataList().isEmpty());
}
Also used : WasOnlyProcessor(com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor) LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) Application(com.navercorp.pinpoint.web.vo.Application) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap) Test(org.junit.Test)

Example 24 with LinkDataMap

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

Example 25 with LinkDataMap

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

the class DefaultApplicationMapCreator method createMap.

@Override
public LinkDataDuplexMap createMap(Application application, LinkSelectContext linkSelectContext) {
    logger.debug("Finding Caller/Callee link data for {}", application);
    final Range range = linkSelectContext.getRange();
    LinkDataDuplexMap searchResult = new LinkDataDuplexMap();
    final boolean searchCallerNode = linkSelectContext.checkNextCaller(application);
    if (searchCallerNode) {
        logger.debug("Finding Caller link data for {}", application);
        final LinkDataMap callerLinkDataMap = linkDataMapService.selectCallerLinkDataMap(application, range);
        logger.debug("Found Caller. count={}, caller={}, depth={}", callerLinkDataMap.size(), application, linkSelectContext.getCallerDepth());
        final LinkDataMap processedCallerLinkDataMap = callerLinkDataMapProcessor.processLinkDataMap(callerLinkDataMap, range);
        for (LinkData callerLinkData : processedCallerLinkDataMap.getLinkDataList()) {
            searchResult.addSourceLinkData(callerLinkData);
            final Application toApplication = callerLinkData.getToApplication();
            // skip if nextApplication is a terminal or an unknown cloud
            if (toApplication.getServiceType().isTerminal() || toApplication.getServiceType().isUnknown()) {
                continue;
            }
            linkSelectContext.addNextApplication(toApplication);
        }
    }
    final boolean searchCalleeNode = linkSelectContext.checkNextCallee(application);
    if (searchCalleeNode) {
        logger.debug("Finding Callee link data for {}", application);
        final LinkDataMap calleeLinkDataMap = linkDataMapService.selectCalleeLinkDataMap(application, range);
        logger.debug("Found Callee. count={}, callee={}, depth={}", calleeLinkDataMap.size(), application, linkSelectContext.getCalleeDepth());
        final LinkDataMap processedCalleeLinkDataMap = calleeLinkDataMapProcessor.processLinkDataMap(calleeLinkDataMap, range);
        for (LinkData calleeLinkData : processedCalleeLinkDataMap.getLinkDataList()) {
            searchResult.addTargetLinkData(calleeLinkData);
            final Application fromApplication = calleeLinkData.getFromApplication();
            linkSelectContext.addNextApplication(fromApplication);
        }
    }
    return searchResult;
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Aggregations

LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)35 Application (com.navercorp.pinpoint.web.vo.Application)30 Test (org.junit.Test)22 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)20 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)15 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)14 Range (com.navercorp.pinpoint.web.vo.Range)14 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)9 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)6 VirtualLinkMarker (com.navercorp.pinpoint.web.service.map.VirtualLinkMarker)6 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)4 WasOnlyProcessor (com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor)4 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)3 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)3 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)3 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)2 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)2 LinkCallDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap)2 MapStatisticsTimeWindowReducer (com.navercorp.pinpoint.web.mapper.MapStatisticsTimeWindowReducer)2 RowMapReduceResultExtractor (com.navercorp.pinpoint.web.mapper.RowMapReduceResultExtractor)2