use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.
the class MapController method getLastServerMapData.
/**
* Server map data query for the last "Period" timeframe
*
* @param applicationName
* @param serviceTypeCode
* @param period
* @return
*/
@RequestMapping(value = "/getLastServerMapData", method = RequestMethod.GET, params = "serviceTypeCode")
@ResponseBody
public MapWrap getLastServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeCode") short serviceTypeCode, @RequestParam("period") long period, @RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH) int callerRange, @RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH) int calleeRange) {
long to = TimeUtils.getDelayLastTime();
long from = to - period;
final Range range = new Range(from, to);
this.dateLimit.limit(range);
SearchOption searchOption = new SearchOption(callerRange, calleeRange);
assertSearchOption(searchOption);
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode);
return selectApplicationMap(application, range, searchOption);
}
use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.
the class MapController method getLastServerMapData.
/**
* Server map data query for the last "Period" timeframe
*
* @param applicationName
* @param serviceTypeName
* @param period
* @return
*/
@RequestMapping(value = "/getLastServerMapData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public MapWrap getLastServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("period") long period, @RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH) int callerRange, @RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH) int calleeRange) {
long to = TimeUtils.getDelayLastTime();
long from = to - period;
final Range range = new Range(from, to);
this.dateLimit.limit(range);
SearchOption searchOption = new SearchOption(callerRange, calleeRange);
assertSearchOption(searchOption);
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName);
return selectApplicationMap(application, range, searchOption);
}
use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.
the class ScatterChartController method getScatterData.
/**
* @param applicationName
* @param from
* @param to
* @param limit max number of data return. if the requested data exceed this limit, we need additional calls to
* fetch the rest of the data
* @return
*/
@RequestMapping(value = "/getScatterData", method = RequestMethod.GET)
public ModelAndView getScatterData(@RequestParam("application") String applicationName, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam("xGroupUnit") int xGroupUnit, @RequestParam("yGroupUnit") int yGroupUnit, @RequestParam("limit") int limit, @RequestParam(value = "backwardDirection", required = false, defaultValue = "true") boolean backwardDirection, @RequestParam(value = "filter", required = false) String filterText, @RequestParam(value = "_callback", required = false) String jsonpCallback, @RequestParam(value = "v", required = false, defaultValue = "1") int version) {
if (xGroupUnit <= 0) {
throw new IllegalArgumentException("xGroupUnit(" + xGroupUnit + ") must be positive number");
}
if (yGroupUnit < 0) {
throw new IllegalArgumentException("yGroupUnit(" + yGroupUnit + ") may not be negative number");
}
limit = LimitUtils.checkRange(limit);
StopWatch watch = new StopWatch();
watch.start("getScatterData");
// TODO range check verification exception occurs. "from" is bigger than "to"
final Range range = Range.createUncheckedRange(from, to);
logger.debug("fetch scatter data. RANGE={}, X-Group-Unit:{}, Y-Group-Unit:{}, LIMIT={}, BACKWARD_DIRECTION:{}, FILTER:{}", range, xGroupUnit, yGroupUnit, limit, backwardDirection, filterText);
ModelAndView mv = null;
if (StringUtils.isEmpty(filterText)) {
mv = selectScatterData(applicationName, range, xGroupUnit, Math.max(yGroupUnit, 1), limit, backwardDirection, version);
} else {
mv = selectFilterScatterData(applicationName, range, xGroupUnit, Math.max(yGroupUnit, 1), limit, backwardDirection, filterText, version);
}
if (jsonpCallback == null) {
mv.setViewName("jsonView");
} else {
mv.setViewName("jsonpView");
}
watch.stop();
logger.info("Fetch scatterData time : {}ms", watch.getLastTaskTimeMillis());
return mv;
}
use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.
the class MapStatisticsCallerDataCollector method collect.
@Override
public void collect() {
if (init.get()) {
return;
}
LinkDataMap callerDataMap = mapStatisticsCallerDao.selectCaller(application, new Range(timeSlotEndTime - slotInterval, timeSlotEndTime));
for (LinkData linkData : callerDataMap.getLinkDataList()) {
LinkCallDataMap linkCallDataMap = linkData.getLinkCallDataMap();
for (LinkCallData linkCallData : linkCallDataMap.getLinkDataList()) {
calleStatMap.put(linkCallData.getTarget(), linkCallData);
}
}
init.set(true);
}
use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.
the class ResponseTimeDataCollector method collect.
@Override
public void collect() {
if (init.get()) {
return;
}
Range range = Range.createUncheckedRange(timeSlotEndTime - slotInterval, timeSlotEndTime);
List<ResponseTime> responseTimes = responseDao.selectResponseTime(application, range);
for (ResponseTime responseTime : responseTimes) {
sum(responseTime.getAgentResponseHistogramList());
}
setSlowRate();
setErrorRate();
init.set(true);
}
Aggregations