Search in sources :

Example 1 with TransactionId

use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.

the class DefaultTraceIdFactory method continueTraceId.

public TraceId continueTraceId(String transactionId, long parentSpanId, long spanId, short flags) {
    Objects.requireNonNull(transactionId, "transactionId");
    final TransactionId parseId = TransactionIdUtils.parseTransactionId(transactionId);
    return new DefaultTraceId(parseId.getAgentId(), parseId.getAgentStartTime(), parseId.getTransactionSequence(), parentSpanId, spanId, flags);
}
Also used : TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 2 with TransactionId

use of com.navercorp.pinpoint.common.profiler.util.TransactionId 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 3 with TransactionId

use of com.navercorp.pinpoint.common.profiler.util.TransactionId 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 4 with TransactionId

use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.

the class LinkedCallTree method createMultiChildSpanAlign.

private SpanAlign createMultiChildSpanAlign(short serviceType, long startTime) {
    SpanBo spanBo = new SpanBo();
    spanBo.setTransactionId(new TransactionId("UNKNOWN", 0, 0));
    spanBo.setServiceType(serviceType);
    spanBo.setStartTime(startTime);
    AnnotationBo multiChildAnnotation = createMultiChildAnnotation();
    List<AnnotationBo> annotationBoList = new ArrayList<>();
    annotationBoList.add(multiChildAnnotation);
    spanBo.setAnnotationBoList(annotationBoList);
    return new SpanAlign(spanBo, true);
}
Also used : AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) ArrayList(java.util.ArrayList) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 5 with TransactionId

use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.

the class MetaSpanCallTreeFactory method corrupted.

public SpanCallTree corrupted(final String title, final long parentSpanId, final long spanId, final long startTimeMillis) {
    final SpanBo rootSpan = new SpanBo();
    rootSpan.setParentSpanId(parentSpanId);
    rootSpan.setSpanId(spanId);
    rootSpan.setStartTime(startTimeMillis);
    rootSpan.setTransactionId(new TransactionId(CORRUPTED_AGENT_ID, AGENT_START_TIME, 0));
    rootSpan.setAgentId(CORRUPTED_AGENT_ID);
    rootSpan.setApplicationId("CORRUPTED");
    rootSpan.setServiceType(ServiceType.UNKNOWN.getCode());
    List<AnnotationBo> annotations = new ArrayList<>();
    ApiMetaDataBo apiMetaData = new ApiMetaDataBo(CORRUPTED_AGENT_ID, AGENT_START_TIME, 0, LineNumber.NO_LINE_NUMBER, MethodTypeEnum.CORRUPTED, "...");
    final AnnotationBo apiMetaDataAnnotation = new AnnotationBo(AnnotationKey.API_METADATA.getCode(), apiMetaData);
    annotations.add(apiMetaDataAnnotation);
    int key = AnnotationKeyUtils.getArgs(0).getCode();
    String errorMessage = getErrorMessage(title, startTimeMillis);
    final AnnotationBo argumentAnnotation = new AnnotationBo(key, errorMessage);
    annotations.add(argumentAnnotation);
    rootSpan.setAnnotationBoList(annotations);
    return new MetaSpanCallTree(new SpanAlign(rootSpan, true));
}
Also used : AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) ArrayList(java.util.ArrayList) ApiMetaDataBo(com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Aggregations

TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)51 Test (org.junit.Test)18 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)15 ArrayList (java.util.ArrayList)12 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)9 ByteBuffer (java.nio.ByteBuffer)6 List (java.util.List)6 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)5 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)4 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)4 DefaultTraceId (com.navercorp.pinpoint.profiler.context.id.DefaultTraceId)4 ColumnGetCount (com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount)3 DefaultTraceRoot (com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot)3 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)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 TableName (org.apache.hadoop.hbase.TableName)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3