Search in sources :

Example 26 with SpanChunkBo

use of com.navercorp.pinpoint.common.server.bo.SpanChunkBo in project pinpoint by naver.

the class Node method buildSpanChunkBaseAligns.

private List<Align> buildSpanChunkBaseAligns(List<SpanChunkBo> spanChunkBoList) {
    if (CollectionUtils.isEmpty(spanChunkBoList)) {
        return Collections.emptyList();
    }
    List<Align> alignList = new ArrayList<>();
    for (SpanChunkBo chunkBo : spanChunkBoList) {
        if (chunkBo.isAsyncSpanChunk()) {
            // asyncSpanEvent
            continue;
        }
        List<SpanEventBo> spanEventList = chunkBo.getSpanEventBoList();
        for (SpanEventBo spanEventBo : spanEventList) {
            if (logger.isTraceEnabled()) {
                logger.trace("Populate spanEvent{seq={}, depth={}, event={}}", spanEventBo.getSequence(), spanEventBo.getDepth(), spanEventBo);
            }
            final Align spanEventAlign = this.newSpanEventAlign(chunkBo, spanEventBo);
            alignList.add(spanEventAlign);
        }
    }
    return alignList;
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) ArrayList(java.util.ArrayList) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Example 27 with SpanChunkBo

use of com.navercorp.pinpoint.common.server.bo.SpanChunkBo in project pinpoint by naver.

the class CallStackMock method push.

public void push() {
    final SpanEventBo spanEvent = new SpanEventBo();
    final int startElapsed = (int) (currentTime - spanBo.getStartTime());
    currentTime++;
    spanEvent.setStartElapsed(startElapsed);
    spanEvent.setSequence(sequence++);
    checkExtend(index + 1);
    stack[index++] = spanEvent;
    if (this.latestStackIndex != this.index) {
        this.latestStackIndex = this.index;
        spanEvent.setDepth(this.latestStackIndex);
    }
    final SpanEventAlign spanEventAlign;
    if (this.async) {
        LocalAsyncIdBo localAsyncIdBo = new LocalAsyncIdBo(asyncId, 1);
        SpanChunkBo spanChunkBo = new SpanChunkBo();
        spanChunkBo.setLocalAsyncId(localAsyncIdBo);
        spanEventAlign = new SpanChunkEventAlign(spanBo, spanChunkBo, spanEvent);
    } else {
        spanEventAlign = new SpanEventAlign(spanBo, spanEvent);
    }
    callTree.add(spanEvent.getDepth(), spanEventAlign);
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) LocalAsyncIdBo(com.navercorp.pinpoint.common.server.bo.LocalAsyncIdBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Aggregations

SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)27 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)13 Test (org.junit.Test)8 Header (com.navercorp.pinpoint.grpc.Header)5 TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)4 LocalAsyncIdBo (com.navercorp.pinpoint.common.server.bo.LocalAsyncIdBo)4 PSpanChunk (com.navercorp.pinpoint.grpc.trace.PSpanChunk)4 ByteBuffer (java.nio.ByteBuffer)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)3 ArrayList (java.util.ArrayList)3 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)2 TSpanChunk (com.navercorp.pinpoint.thrift.dto.TSpanChunk)2 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)2 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)1 StringCacheableBuffer (com.navercorp.pinpoint.common.buffer.StringCacheableBuffer)1 SpanDecoder (com.navercorp.pinpoint.common.server.bo.serializer.trace.v2.SpanDecoder)1 SpanDecodingContext (com.navercorp.pinpoint.common.server.bo.serializer.trace.v2.SpanDecodingContext)1 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1 PLocalAsyncId (com.navercorp.pinpoint.grpc.trace.PLocalAsyncId)1