Search in sources :

Example 1 with ColumnGetCount

use of com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount in project pinpoint by naver.

the class BusinessTransactionController method traceViewerData.

@GetMapping(value = "/traceViewerData")
public TraceViewerDataViewModel traceViewerData(@RequestParam("traceId") String traceIdParam, @RequestParam(value = "focusTimestamp", required = false, defaultValue = "0") long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = "-1") long spanId) {
    logger.debug("GET /traceViewerData params {traceId={}, focusTimestamp={}, agentId={}, spanId={}}", traceIdParam, focusTimestamp, agentId, spanId);
    final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceIdParam);
    final ColumnGetCount columnGetCount = ColumnGetCountFactory.create(callstackSelectSpansLimit);
    // select spans
    Predicate<SpanBo> spanMatchFilter = SpanFilters.spanFilter(spanId, agentId, focusTimestamp);
    SpanResult spanResult = this.spanService.selectSpan(transactionId, spanMatchFilter, columnGetCount);
    final CallTreeIterator callTreeIterator = spanResult.getCallTree();
    RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, spanMatchFilter);
    return new TraceViewerDataViewModel(recordSet);
}
Also used : ColumnGetCount(com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount) TraceViewerDataViewModel(com.navercorp.pinpoint.web.view.TraceViewerDataViewModel) CallTreeIterator(com.navercorp.pinpoint.web.calltree.span.CallTreeIterator) SpanResult(com.navercorp.pinpoint.web.service.SpanResult) RecordSet(com.navercorp.pinpoint.web.vo.callstacks.RecordSet) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 2 with ColumnGetCount

use of com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount in project pinpoint by naver.

the class BusinessTransactionController method transactionInfo.

/**
 * info lookup for a selected transaction
 *
 * @param traceId
 * @param focusTimestamp
 * @return
 */
@GetMapping(value = "/transactionInfo")
public TransactionInfoViewModel transactionInfo(@RequestParam("traceId") String traceId, @RequestParam(value = "focusTimestamp", required = false, defaultValue = DEFAULT_FOCUS_TIMESTAMP) long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = DEFAULT_SPANID) long spanId, @RequestParam(value = "v", required = false, defaultValue = "0") int viewVersion, @RequestParam(value = "useStatisticsAgentState", required = false, defaultValue = "false") boolean useStatisticsAgentState, @RequestParam(value = "useLoadHistogramFormat", required = false, defaultValue = "false") boolean useLoadHistogramFormat) {
    logger.debug("GET /transactionInfo params {traceId={}, focusTimestamp={}, agentId={}, spanId={}, v={}}", traceId, focusTimestamp, agentId, spanId, viewVersion);
    final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceId);
    final ColumnGetCount columnGetCount = ColumnGetCountFactory.create(callstackSelectSpansLimit);
    Predicate<SpanBo> spanMatchFilter = SpanFilters.spanFilter(spanId, agentId, focusTimestamp);
    // select spans
    final SpanResult spanResult = this.spanService.selectSpan(transactionId, spanMatchFilter, columnGetCount);
    final CallTreeIterator callTreeIterator = spanResult.getCallTree();
    // application map
    FilteredMapServiceOption.Builder optionBuilder = new FilteredMapServiceOption.Builder(transactionId, viewVersion, columnGetCount);
    final FilteredMapServiceOption option = optionBuilder.setUseStatisticsAgentState(useStatisticsAgentState).build();
    ApplicationMap map = filteredMapService.selectApplicationMap(option);
    RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, spanMatchFilter);
    TransactionInfoViewModel result = new TransactionInfoViewModel(transactionId, spanId, map.getNodes(), map.getLinks(), recordSet, spanResult.getTraceState(), logConfiguration);
    if (useLoadHistogramFormat) {
        result.setTimeHistogramFormat(TimeHistogramFormat.V2);
    }
    return result;
}
Also used : ColumnGetCount(com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount) ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) CallTreeIterator(com.navercorp.pinpoint.web.calltree.span.CallTreeIterator) SpanResult(com.navercorp.pinpoint.web.service.SpanResult) ServletUriComponentsBuilder(org.springframework.web.servlet.support.ServletUriComponentsBuilder) TransactionInfoViewModel(com.navercorp.pinpoint.web.view.TransactionInfoViewModel) RecordSet(com.navercorp.pinpoint.web.vo.callstacks.RecordSet) FilteredMapServiceOption(com.navercorp.pinpoint.web.service.FilteredMapServiceOption) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 3 with ColumnGetCount

use of com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount in project pinpoint by naver.

the class BusinessTransactionController method transactionTimelineInfo.

/**
 * info lookup for a selected transaction
 *
 * @param traceId
 * @param focusTimestamp
 * @return
 */
@GetMapping(value = "/transactionTimelineInfo")
public TransactionTimelineInfoViewModel transactionTimelineInfo(@RequestParam("traceId") String traceId, @RequestParam(value = "focusTimestamp", required = false, defaultValue = DEFAULT_FOCUS_TIMESTAMP) long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = DEFAULT_SPANID) long spanId) {
    logger.debug("GET /transactionTimelineInfo params {traceId={}, focusTimestamp={}, agentId={}, spanId={}}", traceId, focusTimestamp, agentId, spanId);
    final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceId);
    final ColumnGetCount columnGetCount = ColumnGetCountFactory.create(callstackSelectSpansLimit);
    // select spans
    Predicate<SpanBo> spanMatchFilter = SpanFilters.spanFilter(spanId, agentId, focusTimestamp);
    SpanResult spanResult = this.spanService.selectSpan(transactionId, spanMatchFilter, columnGetCount);
    final CallTreeIterator callTreeIterator = spanResult.getCallTree();
    String traceViewerDataURL = ServletUriComponentsBuilder.fromPath("traceViewerData.pinpoint").queryParam("traceId", URLEncoder.encode(traceId, StandardCharsets.UTF_8)).queryParam("focusTimestamp", focusTimestamp).queryParam("agentId", URLEncoder.encode(agentId, StandardCharsets.UTF_8)).queryParam("spanId", spanId).build().toUriString();
    RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, spanMatchFilter);
    return new TransactionTimelineInfoViewModel(transactionId, spanId, recordSet, traceViewerDataURL, logConfiguration);
}
Also used : ColumnGetCount(com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount) CallTreeIterator(com.navercorp.pinpoint.web.calltree.span.CallTreeIterator) SpanResult(com.navercorp.pinpoint.web.service.SpanResult) TransactionTimelineInfoViewModel(com.navercorp.pinpoint.web.view.TransactionTimelineInfoViewModel) RecordSet(com.navercorp.pinpoint.web.vo.callstacks.RecordSet) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

ColumnGetCount (com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount)3 TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)3 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)3 CallTreeIterator (com.navercorp.pinpoint.web.calltree.span.CallTreeIterator)3 SpanResult (com.navercorp.pinpoint.web.service.SpanResult)3 RecordSet (com.navercorp.pinpoint.web.vo.callstacks.RecordSet)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3 ApplicationMap (com.navercorp.pinpoint.web.applicationmap.ApplicationMap)1 FilteredMapServiceOption (com.navercorp.pinpoint.web.service.FilteredMapServiceOption)1 TraceViewerDataViewModel (com.navercorp.pinpoint.web.view.TraceViewerDataViewModel)1 TransactionInfoViewModel (com.navercorp.pinpoint.web.view.TransactionInfoViewModel)1 TransactionTimelineInfoViewModel (com.navercorp.pinpoint.web.view.TransactionTimelineInfoViewModel)1 ServletUriComponentsBuilder (org.springframework.web.servlet.support.ServletUriComponentsBuilder)1