Search in sources :

Example 1 with SpanChunkBo

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

the class GrpcSpanChunkHandler method handleSpanChunk.

private void handleSpanChunk(PSpanChunk spanChunk) {
    if (isDebug) {
        logger.debug("Handle PSpanChunk={}", createSimpleSpanChunkLog(spanChunk));
    }
    try {
        final Header agentInfo = ServerContext.getAgentInfo();
        final SpanChunkBo spanChunkBo = spanFactory.buildSpanChunkBo(spanChunk, agentInfo);
        this.traceService.insertSpanChunk(spanChunkBo);
    } catch (Exception e) {
        logger.warn("Failed to handle spanChunk={}", MessageFormatUtils.debugLog(spanChunk), e);
    }
}
Also used : Header(com.navercorp.pinpoint.grpc.Header) SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo)

Example 2 with SpanChunkBo

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

the class ThriftSpanChunkHandler method handleSpanChunk.

private void handleSpanChunk(TSpanChunk tbase) {
    try {
        final SpanChunkBo spanChunkBo = this.spanFactory.buildSpanChunkBo(tbase);
        this.traceService.insertSpanChunk(spanChunkBo);
    } catch (Exception e) {
        logger.warn("Failed to handle SpanChunk={}, Caused={}", tbase, e.getMessage(), e);
    }
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo)

Example 3 with SpanChunkBo

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

the class CollectorGrpcSpanFactoryTest method buildSpanChunkBo_first_depth_zero.

@Test
public void buildSpanChunkBo_first_depth_zero() {
    final PSpanChunk chunk = newSpanChunk_first_depth_zero();
    final Header header = newHeader();
    SpanChunkBo spanChunkBo = factory.buildSpanChunkBo(chunk, header);
    List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
    SpanEventBo spanEventBo0 = spanEventBoList.get(0);
    SpanEventBo spanEventBo1 = spanEventBoList.get(1);
    Assert.assertEquals(0, spanEventBo0.getDepth());
    Assert.assertEquals(1, spanEventBo1.getDepth());
}
Also used : Header(com.navercorp.pinpoint.grpc.Header) SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) PSpanChunk(com.navercorp.pinpoint.grpc.trace.PSpanChunk) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) Test(org.junit.Test)

Example 4 with SpanChunkBo

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

the class CollectorGrpcSpanFactoryTest method buildSpanChunkBo_compact_depth_NPE.

@Test
public void buildSpanChunkBo_compact_depth_NPE() {
    final PSpanChunk chunk = newSpanChunk_compact_depth_error();
    final Header header = newHeader();
    SpanChunkBo spanChunkBo = factory.buildSpanChunkBo(chunk, header);
    List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
    SpanEventBo spanEventBo0 = spanEventBoList.get(0);
    Assert.assertEquals(1, spanEventBo0.getDepth());
}
Also used : Header(com.navercorp.pinpoint.grpc.Header) SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) PSpanChunk(com.navercorp.pinpoint.grpc.trace.PSpanChunk) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) Test(org.junit.Test)

Example 5 with SpanChunkBo

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

the class SpanEncoderTest method testEncodeSpanColumnValue_simpleSpanChunk.

@Test
public void testEncodeSpanColumnValue_simpleSpanChunk() throws Exception {
    SpanChunkBo spanChunkBo = randomSpanChunk();
    assertSpanChunk(spanChunkBo);
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) Test(org.junit.Test)

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