use of com.navercorp.pinpoint.web.applicationmap.ApplicationMap in project pinpoint by naver.
the class FilteredMapServiceImpl method selectApplicationMap.
/**
* filtered application map
*/
@Override
public ApplicationMap selectApplicationMap(List<TransactionId> transactionIdList, Range originalRange, Range scanRange, Filter filter) {
if (transactionIdList == null) {
throw new NullPointerException("transactionIdList must not be null");
}
if (filter == null) {
throw new NullPointerException("filter must not be null");
}
StopWatch watch = new StopWatch();
watch.start();
final List<List<SpanBo>> filterList = selectFilteredSpan(transactionIdList, filter);
DotExtractor dotExtractor = createDotExtractor(scanRange, filterList);
ApplicationMap map = createMap(originalRange, scanRange, filterList);
ApplicationMapWithScatterScanResult applicationMapWithScatterScanResult = new ApplicationMapWithScatterScanResult(map, dotExtractor.getApplicationScatterScanResult());
watch.stop();
logger.debug("Select filtered application map elapsed. {}ms", watch.getTotalTimeMillis());
return applicationMapWithScatterScanResult;
}
use of com.navercorp.pinpoint.web.applicationmap.ApplicationMap 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(Application sourceApplication, Range range, SearchOption searchOption) {
if (sourceApplication == null) {
throw new NullPointerException("sourceApplication must not be null");
}
if (range == null) {
throw new NullPointerException("range must not be null");
}
logger.debug("SelectApplicationMap");
StopWatch watch = new StopWatch("ApplicationMap");
watch.start("ApplicationMap Hbase Io Fetch(Caller,Callee) Time");
LinkSelector linkSelector = new BFSLinkSelector(this.mapStatisticsCallerDao, this.mapStatisticsCalleeDao, hostApplicationMapDao, serverMapDataFilter);
LinkDataDuplexMap linkDataDuplexMap = linkSelector.select(sourceApplication, range, searchOption);
watch.stop();
watch.start("ApplicationMap MapBuilding(Response) Time");
ApplicationMapBuilder builder = new ApplicationMapBuilder(range);
ApplicationMap map = builder.build(linkDataDuplexMap, agentInfoService, this.mapResponseDao);
if (map.getNodes().isEmpty()) {
map = builder.build(sourceApplication, agentInfoService);
}
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.applicationmap.ApplicationMap in project pinpoint by naver.
the class BusinessTransactionController method transactionInfo.
/**
* info lookup for a selected transaction
*
* @param traceIdParam
* @param focusTimestamp
* @return
*/
@RequestMapping(value = "/transactionInfo", method = RequestMethod.GET)
@ResponseBody
public TransactionInfoViewModel transactionInfo(@RequestParam("traceId") String traceIdParam, @RequestParam(value = "focusTimestamp", required = false, defaultValue = "0") long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = "-1") long spanId, @RequestParam(value = "v", required = false, defaultValue = "0") int viewVersion) {
logger.debug("GET /transactionInfo params {traceId={}, focusTimestamp={}, agentId={}, spanId={}, v={}}", traceIdParam, focusTimestamp, agentId, spanId, viewVersion);
final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceIdParam);
// select spans
final SpanResult spanResult = this.spanService.selectSpan(transactionId, focusTimestamp);
final CallTreeIterator callTreeIterator = spanResult.getCallTree();
// application map
ApplicationMap map = filteredMapService.selectApplicationMap(transactionId);
RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, focusTimestamp, agentId, spanId);
TransactionInfoViewModel result = new TransactionInfoViewModel(transactionId, map.getNodes(), map.getLinks(), recordSet, spanResult.getCompleteTypeString(), logLinkEnable, logButtonName, logPageUrl, disableButtonMessage);
return result;
}
use of com.navercorp.pinpoint.web.applicationmap.ApplicationMap in project pinpoint by naver.
the class FilteredMapController method getFilteredServerMapDataMadeOfDotGroup.
@RequestMapping(value = "/getFilteredServerMapDataMadeOfDotGroup", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public FilterMapWrap getFilteredServerMapDataMadeOfDotGroup(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam("originTo") long originTo, @RequestParam("xGroupUnit") int xGroupUnit, @RequestParam("yGroupUnit") int yGroupUnit, @RequestParam(value = "filter", required = false) String filterText, @RequestParam(value = "hint", required = false) String filterHint, @RequestParam(value = "limit", required = false, defaultValue = "10000") int limit) {
if (xGroupUnit <= 0) {
throw new IllegalArgumentException("xGroupUnit(" + xGroupUnit + ") must be positive number");
}
if (yGroupUnit <= 0) {
throw new IllegalArgumentException("yGroupUnit(" + yGroupUnit + ") must be positive number");
}
limit = LimitUtils.checkRange(limit);
final Filter filter = filterBuilder.build(filterText, filterHint);
final Range range = new Range(from, to);
final LimitedScanResult<List<TransactionId>> limitedScanResult = filteredMapService.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit);
final long lastScanTime = limitedScanResult.getLimitedTime();
// original range: needed for visual chart data sampling
final Range originalRange = new Range(from, originTo);
// needed to figure out already scanned ranged
final Range scannerRange = new Range(lastScanTime, to);
logger.debug("originalRange:{} scannerRange:{} ", originalRange, scannerRange);
ApplicationMap map = filteredMapService.selectApplicationMapWithScatterData(limitedScanResult.getScanData(), originalRange, scannerRange, xGroupUnit, yGroupUnit, filter);
if (logger.isDebugEnabled()) {
logger.debug("getFilteredServerMapData range scan(limit:{}) range:{} lastFetchedTimestamp:{}", limit, range.prettyToString(), DateUtils.longToDateStr(lastScanTime));
}
FilterMapWrap mapWrap = new FilterMapWrap(map);
mapWrap.setLastFetchedTimestamp(lastScanTime);
return mapWrap;
}
use of com.navercorp.pinpoint.web.applicationmap.ApplicationMap in project pinpoint by naver.
the class MapController method selectApplicationMap.
private MapWrap selectApplicationMap(Application application, Range range, SearchOption searchOption) {
if (application == null) {
throw new NullPointerException("application must not be null");
}
if (range == null) {
throw new NullPointerException("range must not be null");
}
if (searchOption == null) {
throw new NullPointerException("searchOption must not be null");
}
logger.info("getServerMap() application:{} range:{} searchOption:{}", application, range, searchOption);
ApplicationMap map = mapService.selectApplicationMap(application, range, searchOption);
return new MapWrap(map);
}
Aggregations