Search in sources :

Example 11 with ApplicationMap

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;
}
Also used : ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) ApplicationMapWithScatterScanResult(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult) ArrayList(java.util.ArrayList) List(java.util.List) StopWatch(org.springframework.util.StopWatch)

Example 12 with ApplicationMap

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;
}
Also used : ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) StopWatch(org.springframework.util.StopWatch) ApplicationMapBuilder(com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)

Example 13 with ApplicationMap

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;
}
Also used : ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) CallTreeIterator(com.navercorp.pinpoint.web.calltree.span.CallTreeIterator) SpanResult(com.navercorp.pinpoint.web.service.SpanResult) TransactionInfoViewModel(com.navercorp.pinpoint.web.view.TransactionInfoViewModel) RecordSet(com.navercorp.pinpoint.web.vo.callstacks.RecordSet) TransactionId(com.navercorp.pinpoint.common.util.TransactionId) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 14 with ApplicationMap

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;
}
Also used : ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) Filter(com.navercorp.pinpoint.web.filter.Filter) List(java.util.List) Range(com.navercorp.pinpoint.web.vo.Range) FilterMapWrap(com.navercorp.pinpoint.web.applicationmap.FilterMapWrap) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 15 with ApplicationMap

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);
}
Also used : ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) MapWrap(com.navercorp.pinpoint.web.applicationmap.MapWrap)

Aggregations

ApplicationMap (com.navercorp.pinpoint.web.applicationmap.ApplicationMap)16 List (java.util.List)8 StopWatch (org.springframework.util.StopWatch)5 ApplicationMapBuilder (com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)4 Range (com.navercorp.pinpoint.web.vo.Range)4 ArrayList (java.util.ArrayList)4 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)3 FilterMapWrap (com.navercorp.pinpoint.web.applicationmap.FilterMapWrap)3 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)3 Application (com.navercorp.pinpoint.web.vo.Application)3 ApplicationMapWithScatterData (com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData)2 MapWrap (com.navercorp.pinpoint.web.applicationmap.MapWrap)2 CallTreeIterator (com.navercorp.pinpoint.web.calltree.span.CallTreeIterator)2 Filter (com.navercorp.pinpoint.web.filter.Filter)2 FilteredMapServiceOption (com.navercorp.pinpoint.web.service.FilteredMapServiceOption)2 SpanResult (com.navercorp.pinpoint.web.service.SpanResult)2 FilteredMap (com.navercorp.pinpoint.web.service.map.FilteredMap)2 FilteredMapBuilder (com.navercorp.pinpoint.web.service.map.FilteredMapBuilder)2 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2