use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanDecoder method decodeSpanEventBo.
public SpanEventBo decodeSpanEventBo(Buffer qualifier, Buffer valueBuffer, SpanDecodingContext decodingContext) {
SpanEventBo spanEventBo = new SpanEventBo();
long spanId = qualifier.readLong();
decodingContext.setSpanId(spanId);
short sequence = qualifier.readShort();
int asyncId = -1;
if (qualifier.hasRemaining()) {
asyncId = qualifier.readInt();
}
short asyncSequence = -1;
if (qualifier.hasRemaining()) {
asyncSequence = qualifier.readShort();
}
spanEventBo.setSequence(sequence);
spanEventBo.setAsyncId(asyncId);
spanEventBo.setAsyncSequence(asyncSequence);
readSpanEvent(spanEventBo, valueBuffer, decodingContext);
if (logger.isDebugEnabled()) {
logger.debug("read spanEvent :{}", spanEventBo);
}
return spanEventBo;
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanDecoderV0 method readSpanEvent.
private List<SpanEventBo> readSpanEvent(Buffer buffer, SpanEventBo firstSpanEvent, SpanDecodingContext decodingContext) {
final int spanEventSize = buffer.readVInt();
if (spanEventSize <= 0) {
return new ArrayList<SpanEventBo>();
}
final List<SpanEventBo> spanEventBoList = new ArrayList<SpanEventBo>();
SpanEventBo prev = null;
for (int i = 0; i < spanEventSize; i++) {
SpanEventBo spanEvent;
if (i == 0) {
spanEvent = readFirstSpanEvent(buffer, firstSpanEvent, decodingContext);
} else {
spanEvent = readNextSpanEvent(buffer, prev, decodingContext);
}
prev = spanEvent;
spanEventBoList.add(spanEvent);
}
return spanEventBoList;
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo 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());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo 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());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEncoderTest method testEncodeSpanColumnValue_spanEvent_service_equals.
@Test
public void testEncodeSpanColumnValue_spanEvent_service_equals() {
SpanBo spanBo = randomComplexSpan();
SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
spanEventBo1.setServiceType(spanEventBo0.getServiceType());
assertSpan(spanBo);
}
Aggregations