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);
}
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));
}
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);
}
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);
}
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);
}
Aggregations