use of com.navercorp.pinpoint.web.applicationmap.FilterMapWrap in project pinpoint by naver.
the class FilteredMapController method getFilteredServerMapData.
/**
* filtered server map data query within from ~ to timeframe
*
* @param applicationName
* @param serviceTypeName
* @param from
* @param to
* @param filterText
* @param limit
* @return
*/
@RequestMapping(value = "/getFilteredServerMapData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public FilterMapWrap getFilteredServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam("originTo") long originTo, @RequestParam(value = "filter", required = false) String filterText, @RequestParam(value = "hint", required = false) String filterHint, @RequestParam(value = "limit", required = false, defaultValue = "10000") int limit) {
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.selectApplicationMap(limitedScanResult.getScanData(), originalRange, scannerRange, 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.FilterMapWrap in project pinpoint by naver.
the class FilteredMapController method getFilteredServerMapDataMadeOfDotGroup.
@GetMapping(value = "/getFilteredServerMapDataMadeOfDotGroup", params = "serviceTypeName")
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, @RequestParam(value = "v", required = false, defaultValue = "0") int viewVersion, @RequestParam(value = "useStatisticsAgentState", defaultValue = "false", required = false) boolean useStatisticsAgentState, @RequestParam(value = "useLoadHistogramFormat", defaultValue = "false", required = false) boolean useLoadHistogramFormat) {
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<List<SpanBo>> filter = filterBuilder.build(filterText, filterHint);
final Range range = Range.newRange(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 = Range.newRange(from, originTo);
// needed to figure out already scanned ranged
final Range scannerRange = Range.newRange(lastScanTime, to);
logger.debug("originalRange:{} scannerRange:{} ", originalRange, scannerRange);
final FilteredMapServiceOption option = new FilteredMapServiceOption.Builder(limitedScanResult.getScanData(), originalRange, scannerRange, xGroupUnit, yGroupUnit, filter, viewVersion).setUseStatisticsAgentState(useStatisticsAgentState).build();
final ApplicationMap map = filteredMapService.selectApplicationMapWithScatterData(option);
if (logger.isDebugEnabled()) {
logger.debug("getFilteredServerMapData range scan(limit:{}) range:{} lastFetchedTimestamp:{}", limit, range.prettyToString(), DateTimeFormatUtils.format(lastScanTime));
}
FilterMapWrap mapWrap;
if (useLoadHistogramFormat) {
mapWrap = new FilterMapWrap(map, TimeHistogramFormat.V2);
} else {
mapWrap = new FilterMapWrap(map, TimeHistogramFormat.V1);
}
mapWrap.setLastFetchedTimestamp(lastScanTime);
return mapWrap;
}
use of com.navercorp.pinpoint.web.applicationmap.FilterMapWrap 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;
}
Aggregations