@GetMapping(value = "/getFilteredServerMapDataMadeOfDotGroup")
    public FilterMapView getFilteredServerMapDataMadeOfDotGroup(
            @Valid @ModelAttribute
            ApplicationForm appForm,
            @Valid @ModelAttribute
            RangeForm rangeForm,
            @RequestParam("originTo") long originTo,
            @Valid @ModelAttribute
            GroupForm groupForm,
            @Valid @ModelAttribute
            FilterForm filterForm,
            @RequestParam(value = "limit", required = false, defaultValue = "10000")
            @PositiveOrZero int limitParam,
            @RequestParam(value = "useStatisticsAgentState", defaultValue = "false", required = false)
            boolean useStatisticsAgentState,
            @RequestParam(value = "useLoadHistogramFormat", defaultValue = "false", required = false)
            boolean useLoadHistogramFormat
    ) {
        final String applicationName = appForm.getApplicationName();

        final int limit = Math.min(limitParam, LimitUtils.MAX);
        final Filter<List<SpanBo>> filter = newFilter(filterForm);
        final Range range = toRange(rangeForm);
        final LimitedScanResult<List<TransactionId>> limitedScanResult =
                filteredMapService.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit);

        final long lastScanTime = limitedScanResult.limitedTime();
        // original range: needed for visual chart data sampling
        final Range originalRange = Range.between(rangeForm.getFrom(), originTo);
        // needed to figure out already scanned ranged
        final Range scannerRange = Range.between(lastScanTime, rangeForm.getTo());
        logger.debug("originalRange: {}, scannerRange: {}", originalRange, scannerRange);
        final FilteredMapServiceOption option = newFilteredOption(limitedScanResult.scanData(), originalRange, groupForm, filter, useStatisticsAgentState);
        final FilterMapWithScatter scatter = filteredMapService.selectApplicationMapWithScatterData(option);
        ApplicationMap map = scatter.getApplicationMap();

        if (logger.isDebugEnabled()) {
            logger.debug("getFilteredServerMapData range scan(limit:{}) range:{} lastFetchedTimestamp:{}",
                    limit, range.prettyToString(), DateTimeFormatUtils.format(lastScanTime));
        }

        TimeHistogramFormat format = TimeHistogramFormat.format(useLoadHistogramFormat);
        ApplicationMapView applicationMapView = new ApplicationMapView(map, MapViews.ofDetailed(), hyperLinkFactory, format);
        ScatterDataMapView scatterDataMapView = new ScatterDataMapView(scatter.getScatterDataMap());
        return new FilterMapView(applicationMapView, scatterDataMapView, lastScanTime);
    }
@author emeroad
@author netspider
@author jaehong.kim
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/FilteredMapController.java