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;
}
Aggregations