Search in sources :

Example 91 with Range

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);
}
Also used : SearchOption(com.navercorp.pinpoint.web.vo.SearchOption) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 92 with Range

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);
}
Also used : SearchOption(com.navercorp.pinpoint.web.vo.SearchOption) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 93 with Range

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;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) Range(com.navercorp.pinpoint.web.vo.Range) StopWatch(org.springframework.util.StopWatch) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 94 with Range

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);
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) Range(com.navercorp.pinpoint.web.vo.Range) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Example 95 with Range

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);
}
Also used : ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime) Range(com.navercorp.pinpoint.web.vo.Range)

Aggregations

Range (com.navercorp.pinpoint.web.vo.Range)101 Test (org.junit.Test)62 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)23 AgentStatus (com.navercorp.pinpoint.web.vo.AgentStatus)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)16 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)15 Application (com.navercorp.pinpoint.web.vo.Application)12 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)9 List (java.util.List)8 AgentEvent (com.navercorp.pinpoint.web.vo.AgentEvent)7 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)7 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)6 JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)6 AgentStatDataPoint (com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint)5 TimeWindowSlotCentricSampler (com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler)5 LegacyAgentStatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup)5 ArrayList (java.util.ArrayList)5 TimeWindowSampler (com.navercorp.pinpoint.web.util.TimeWindowSampler)4 StopWatch (org.springframework.util.StopWatch)4 ApplicationIndexDao (com.navercorp.pinpoint.web.dao.ApplicationIndexDao)3