Search in sources :

Example 71 with SpanEventBo

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

the class CollectorGrpcSpanFactoryTest method buildSpanChunkBo_sequence_overflow_NPE.

@Test
public void buildSpanChunkBo_sequence_overflow_NPE() {
    final PSpanChunk chunk = newSpanChunk_overflow();
    final Header header = newHeader();
    SpanChunkBo spanChunkBo = factory.buildSpanChunkBo(chunk, header);
    List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
    Assert.assertTrue(spanEventBoList.isEmpty());
}
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 72 with SpanEventBo

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

the class CollectorGrpcSpanFactoryTest method buildSpanChunkBo_compact_depth.

@Test
public void buildSpanChunkBo_compact_depth() {
    final PSpanChunk chunk = newSpanChunk_compact_depth();
    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(1, 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 73 with SpanEventBo

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

the class SpanEncoderTest method testEncodeSpanColumnValue_spanEvent_depth_equals.

@Test
public void testEncodeSpanColumnValue_spanEvent_depth_equals() {
    SpanBo spanBo = randomComplexSpan();
    SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
    SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
    spanEventBo1.setDepth(spanEventBo0.getDepth());
    assertSpan(spanBo);
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) Test(org.junit.Test)

Example 74 with SpanEventBo

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

the class SpanEncoderTest method assertSpan.

private void assertSpan(SpanBo spanBo) {
    spanBo.setCollectorAcceptTime(getCollectorAcceptTime());
    SpanEncodingContext<SpanBo> encodingContext = new SpanEncodingContext<>(spanBo);
    Buffer qualifier = wrapBuffer(spanEncoder.encodeSpanQualifier(encodingContext));
    Buffer column = wrapBuffer(spanEncoder.encodeSpanColumnValue(encodingContext));
    SpanDecodingContext decodingContext = new SpanDecodingContext();
    decodingContext.setTransactionId(spanBo.getTransactionId());
    decodingContext.setCollectorAcceptedTime(spanBo.getCollectorAcceptTime());
    SpanBo decode = (SpanBo) spanDecoder.decode(qualifier, column, decodingContext);
    // TODO Check CI log
    // logger.debug("span dump \noriginal spanBo:{} \ndecode spanBo:{} ", spanBo, decode);
    List<String> notSerializedField = newArrayList("parentApplicationId", "parentApplicationServiceType");
    List<String> excludeField = newArrayList("annotationBoList", "spanEventBoList");
    notSerializedField.addAll(excludeField);
    Assert.assertTrue(EqualsBuilder.reflectionEquals(decode, spanBo, notSerializedField));
    logger.debug("{} {}", spanBo.getAnnotationBoList(), decode.getAnnotationBoList());
    Assert.assertTrue("annotation", EqualsBuilder.reflectionEquals(spanBo.getAnnotationBoList(), decode.getAnnotationBoList()));
    List<SpanEventBo> spanEventBoList = spanBo.getSpanEventBoList();
    List<SpanEventBo> decodedSpanEventBoList = decode.getSpanEventBoList();
    Assert.assertTrue(EqualsBuilder.reflectionEquals(spanEventBoList, decodedSpanEventBoList));
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) ByteBuffer(java.nio.ByteBuffer) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Example 75 with SpanEventBo

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

the class SpanEventBitFieldTest method testAnnotation_first.

@Test
public void testAnnotation_first() throws Exception {
    SpanEventBo spanEventBo = new SpanEventBo();
    spanEventBo.setAnnotationBoList(Collections.singletonList(new AnnotationBo(1, "test")));
    SpanEventBitField bitField = SpanEventBitField.buildFirst(spanEventBo);
    Assert.assertTrue(bitField.isSetAnnotation());
    bitField.setAnnotation(false);
    Assert.assertFalse(bitField.isSetAnnotation());
}
Also used : AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) Test(org.junit.Test)

Aggregations

SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)94 Test (org.junit.Test)39 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)26 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)14 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)13 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)11 ArrayList (java.util.ArrayList)11 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)9 ByteBuffer (java.nio.ByteBuffer)8 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)4 LocalAsyncIdBo (com.navercorp.pinpoint.common.server.bo.LocalAsyncIdBo)4 Header (com.navercorp.pinpoint.grpc.Header)4 PSpanChunk (com.navercorp.pinpoint.grpc.trace.PSpanChunk)4 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)4 SpanAcceptor (com.navercorp.pinpoint.web.filter.visitor.SpanAcceptor)4 SpanEventVisitor (com.navercorp.pinpoint.web.filter.visitor.SpanEventVisitor)4 SpanReader (com.navercorp.pinpoint.web.filter.visitor.SpanReader)4 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)3 SpanBitFiled (com.navercorp.pinpoint.common.server.bo.serializer.trace.v2.bitfield.SpanBitFiled)3 PSpanEvent (com.navercorp.pinpoint.grpc.trace.PSpanEvent)3