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