Search in sources :

Example 1 with LinkSelectorType

use of com.navercorp.pinpoint.web.service.map.LinkSelectorType 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)

Aggregations

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 WasOnlyProcessor (com.navercorp.pinpoint.web.service.map.processor.WasOnlyProcessor)1 SearchOption (com.navercorp.pinpoint.web.vo.SearchOption)1 StopWatch (org.springframework.util.StopWatch)1