Search in sources :

Example 11 with SpanEventBo

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

the class SpanEncoderTest method testEncodeSpanColumnValue_spanEvent_startTimeDelta_equals.

@Test
public void testEncodeSpanColumnValue_spanEvent_startTimeDelta_equals() {
    SpanBo spanBo = randomComplexSpan();
    SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
    SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
    spanEventBo1.setStartElapsed(spanEventBo0.getStartElapsed());
    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 12 with SpanEventBo

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

the class SpanEncoderTest method assertSpanChunk.

private void assertSpanChunk(SpanChunkBo spanChunkBo) {
    spanChunkBo.setCollectorAcceptTime(getCollectorAcceptTime());
    SpanEncodingContext<SpanChunkBo> encodingContext = new SpanEncodingContext<>(spanChunkBo);
    Buffer qualifier = wrapBuffer(spanEncoder.encodeSpanChunkQualifier(encodingContext));
    Buffer column = wrapBuffer(spanEncoder.encodeSpanChunkColumnValue(encodingContext));
    SpanDecodingContext decodingContext = new SpanDecodingContext();
    decodingContext.setTransactionId(spanChunkBo.getTransactionId());
    decodingContext.setCollectorAcceptedTime(spanChunkBo.getCollectorAcceptTime());
    SpanChunkBo decode = (SpanChunkBo) spanDecoder.decode(qualifier, column, decodingContext);
    // TODO Check CI log
    // logger.debug("spanChunk dump \noriginal spanChunkBo:{} \ndecode spanChunkBo:{} ", spanChunkBo, decode);
    List<String> notSerializedField = newArrayList("endPoint", "serviceType", "applicationServiceType");
    List<String> excludeField = newArrayList("spanEventBoList", "localAsyncId");
    notSerializedField.addAll(excludeField);
    Assert.assertTrue(EqualsBuilder.reflectionEquals(decode, spanChunkBo, notSerializedField));
    List<SpanEventBo> spanEventBoList = spanChunkBo.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) SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Example 13 with SpanEventBo

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

the class SpanFactoryTest method testNewSpanEventBo.

@Test
public void testNewSpanEventBo() {
    TSpanEvent tSpanEvent = random.randomTSpanEvent((short) RandomUtils.nextInt(0, 100));
    SpanEventBo spanEventBo = spanFactory.buildSpanEventBo(tSpanEvent);
    spanFactoryAssert.assertSpanEvent(tSpanEvent, spanEventBo);
}
Also used : TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) Test(org.junit.Test)

Example 14 with SpanEventBo

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

the class SequenceSpanEventFilterTest method testFilter_accept.

@Test
public void testFilter_accept() {
    SpanEventFilter filter = new SequenceSpanEventFilter(100);
    final SpanEventBo spanEventBo = new SpanEventBo();
    spanEventBo.setSequence((short) 11);
    Assert.assertEquals(filter.filter(spanEventBo), SpanEventFilter.ACCEPT);
}
Also used : SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) Test(org.junit.Test)

Example 15 with SpanEventBo

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

the class SequenceSpanEventFilterTest method testFilter_reject.

@Test
public void testFilter_reject() {
    SpanEventFilter filter = new SequenceSpanEventFilter(10);
    final SpanEventBo spanEventBo = new SpanEventBo();
    spanEventBo.setSequence((short) 11);
    Assert.assertEquals(filter.filter(spanEventBo), SpanEventFilter.REJECT);
}
Also used : 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