Search in sources :

Example 86 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class AgentStatController method getAgentStatChart.

@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/chart", method = RequestMethod.GET)
@ResponseBody
public AgentStatChartGroup getAgentStatChart(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to) {
    TimeWindowSampler sampler = new TimeWindowSlotCentricSampler();
    TimeWindow timeWindow = new TimeWindow(new Range(from, to), sampler);
    return this.agentStatChartService.selectAgentChart(agentId, timeWindow);
}
Also used : TimeWindowSampler(com.navercorp.pinpoint.web.util.TimeWindowSampler) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) TimeWindowSlotCentricSampler(com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 87 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class AgentStatController method getAgentStatChartList.

@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/chartList", method = RequestMethod.GET, params = { "interval" })
@ResponseBody
public List<AgentStatChartGroup> getAgentStatChartList(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam("interval") Integer interval) {
    final int minSamplingInterval = 5;
    final long intervalMs = interval < minSamplingInterval ? minSamplingInterval * 1000L : interval * 1000L;
    TimeWindowSampler sampler = new TimeWindowSampler() {

        @Override
        public long getWindowSize(Range range) {
            return intervalMs;
        }
    };
    TimeWindow timeWindow = new TimeWindow(new Range(from, to), sampler);
    return this.agentStatChartService.selectAgentChartList(agentId, timeWindow);
}
Also used : TimeWindowSampler(com.navercorp.pinpoint.web.util.TimeWindowSampler) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) AgentStatDataPoint(com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 88 with Range

use of com.navercorp.pinpoint.web.vo.Range 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 89 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class LegacyAgentStatController method getAgentStatV2.

@Deprecated
@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/getAgentStat/v2", method = RequestMethod.GET)
@ResponseBody
public LegacyAgentStatChartGroup getAgentStatV2(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam(value = "sampleRate", required = false) Integer sampleRate) throws Exception {
    StopWatch watch = new StopWatch();
    watch.start("agentStatService.selectAgentStatList");
    TimeWindow timeWindow = new TimeWindow(new Range(from, to), new TimeWindowSlotCentricSampler());
    LegacyAgentStatChartGroup chartGroup = this.v2Service.selectAgentStatList(agentId, timeWindow);
    watch.stop();
    if (logger.isInfoEnabled()) {
        logger.info("getAgentStatV2(agentId={}, from={}, to={}) : {}ms", agentId, from, to, watch.getLastTaskTimeMillis());
    }
    return chartGroup;
}
Also used : LegacyAgentStatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) StopWatch(org.springframework.util.StopWatch) TimeWindowSlotCentricSampler(com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 90 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class MapController method getServerMapData.

/**
     * Server map data query within from ~ to timeframe
     *
     * @param applicationName
     * @param serviceTypeName
     * @param from
     * @param to
     * @return
     */
@RequestMapping(value = "/getServerMapData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public MapWrap getServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH) int callerRange, @RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH) int calleeRange) {
    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)

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