Search in sources :

Example 1 with WasOnlyProcessor

use of com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor 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 2 with WasOnlyProcessor

use of com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor 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 3 with WasOnlyProcessor

use of com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor 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 4 with WasOnlyProcessor

use of com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor in project pinpoint by naver.

the class MapServiceImpl method selectApplicationMap.

/**
 * Used in the main UI - draws the server map by querying the timeslot by time.
 */
@Override
public ApplicationMap selectApplicationMap(MapServiceOption option) {
    logger.debug("SelectApplicationMap");
    StopWatch watch = new StopWatch("ApplicationMap");
    watch.start("ApplicationMap Hbase Io Fetch(Caller,Callee) Time");
    final SearchOption searchOption = option.getSearchOption();
    LinkSelectorType linkSelectorType = searchOption.getLinkSelectorType();
    int callerSearchDepth = searchOption.getCallerSearchDepth();
    int calleeSearchDepth = searchOption.getCalleeSearchDepth();
    LinkDataMapProcessor callerLinkDataMapProcessor = LinkDataMapProcessor.NO_OP;
    if (searchOption.isWasOnly()) {
        callerLinkDataMapProcessor = new WasOnlyProcessor();
    }
    LinkDataMapProcessor calleeLinkDataMapProcessor = LinkDataMapProcessor.NO_OP;
    LinkSelector linkSelector = linkSelectorFactory.createLinkSelector(linkSelectorType, callerLinkDataMapProcessor, calleeLinkDataMapProcessor);
    LinkDataDuplexMap linkDataDuplexMap = linkSelector.select(Collections.singletonList(option.getSourceApplication()), option.getRange(), callerSearchDepth, calleeSearchDepth);
    watch.stop();
    if (linkDataLimiter.excess(linkDataDuplexMap.getTotalCount())) {
        throw new RuntimeException("Too many link data. Reduce the values of the Inbound/outbound or do not select the bidirectional option. limiter=" + linkDataLimiter.toString(linkDataDuplexMap.getTotalCount()));
    }
    watch.start("ApplicationMap MapBuilding(Response) Time");
    ApplicationMapBuilder builder = createApplicationMapBuilder(option);
    ApplicationMap map = builder.build(linkDataDuplexMap, buildTimeoutMillis);
    if (map.getNodes().isEmpty()) {
        map = builder.build(option.getSourceApplication(), buildTimeoutMillis);
    }
    watch.stop();
    if (logger.isInfoEnabled()) {
        logger.info("ApplicationMap BuildTime: {}", watch.prettyPrint());
    }
    if (serverMapDataFilter != null) {
        map = serverMapDataFilter.dataFiltering(map);
    }
    return map;
}
Also used : SearchOption(com.navercorp.pinpoint.web.vo.SearchOption) ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) WasOnlyProcessor(com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor) LinkDataMapProcessor(com.navercorp.pinpoint.web.service.map.processor.LinkDataMapProcessor) LinkSelectorType(com.navercorp.pinpoint.web.service.map.LinkSelectorType) LinkSelector(com.navercorp.pinpoint.web.service.map.LinkSelector) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) StopWatch(org.springframework.util.StopWatch) ApplicationMapBuilder(com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)

Example 5 with WasOnlyProcessor

use of com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor in project pinpoint by naver.

the class WasOnlyProcessorTest method shouldFilterLinksToTerminalNodes.

@Test
public void shouldFilterLinksToTerminalNodes() {
    // Given
    Application fromApplication = new Application("WAS", ServiceType.TEST_STAND_ALONE);
    ServiceType terminalServiceType = ServiceTypeFactory.of(2222, "TERMINAL", ServiceTypeProperty.TERMINAL);
    Application toApplication = new Application("TERMINAL", terminalServiceType);
    LinkData wasToTerminalLinkData = new LinkData(fromApplication, toApplication);
    LinkDataMap linkDataMap = new LinkDataMap();
    linkDataMap.addLinkData(wasToTerminalLinkData);
    // 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) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) Application(com.navercorp.pinpoint.web.vo.Application) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap) Test(org.junit.Test)

Aggregations

WasOnlyProcessor (com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor)5 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)4 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)4 Application (com.navercorp.pinpoint.web.vo.Application)4 Test (org.junit.Test)4 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1 ApplicationMap (com.navercorp.pinpoint.web.applicationmap.ApplicationMap)1 ApplicationMapBuilder (com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)1 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)1 LinkSelector (com.navercorp.pinpoint.web.service.map.LinkSelector)1 LinkSelectorType (com.navercorp.pinpoint.web.service.map.LinkSelectorType)1 LinkDataMapProcessor (com.navercorp.pinpoint.web.service.map.processor.LinkDataMapProcessor)1 SearchOption (com.navercorp.pinpoint.web.vo.SearchOption)1 StopWatch (org.springframework.util.StopWatch)1