Search in sources :

Example 1 with TimeWindowSlotCentricSampler

use of com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler in project pinpoint by naver.

the class LegacyAgentStatController method getAgentStatV1.

@Deprecated
@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/getAgentStat/v1", method = RequestMethod.GET)
@ResponseBody
public LegacyAgentStatChartGroup getAgentStatV1(@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.v1Service.selectAgentStatList(agentId, timeWindow);
    watch.stop();
    if (logger.isInfoEnabled()) {
        logger.info("getAgentStatV1(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 2 with TimeWindowSlotCentricSampler

use of com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler in project pinpoint by naver.

the class LegacyAgentStatController method getAgentStat.

@Deprecated
@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/getAgentStat", method = RequestMethod.GET)
@ResponseBody
public LegacyAgentStatChartGroup getAgentStat(@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.agentStatService.selectAgentStatList(agentId, timeWindow);
    watch.stop();
    if (logger.isInfoEnabled()) {
        logger.info("getAgentStat(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 3 with TimeWindowSlotCentricSampler

use of com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler 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)
@ResponseBody
public List<AgentStatChartGroup> getAgentStatChartList(@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.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) 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 4 with TimeWindowSlotCentricSampler

use of com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler 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 5 with TimeWindowSlotCentricSampler

use of com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler 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)

Aggregations

TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)8 TimeWindowSlotCentricSampler (com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler)8 Range (com.navercorp.pinpoint.web.vo.Range)5 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 TimeWindowSampler (com.navercorp.pinpoint.web.util.TimeWindowSampler)4 LegacyAgentStatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup)3 StopWatch (org.springframework.util.StopWatch)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3