use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.
the class SpanStreamSendDataPlaner method getSpanChunkBuffer0.
private byte[] getSpanChunkBuffer0() {
if (spanChunkBuffer == null) {
final TSpanChunk spanChunk = toSpanChunk(span);
HeaderTBaseSerializer serializer = new HeaderTBaseSerializerFactory(false, SpanStreamSendDataFactory.DEFAULT_UDP_MAX_BUFFER_SIZE, false).createSerializer();
byte[] spanChunkBuffer;
try {
spanChunkBuffer = serializer.serialize(spanChunk);
this.spanChunkBuffer = spanChunkBuffer;
this.spanChunkSize = serializer.getInterBufferSize();
} catch (TException e) {
logger.warn("Spanchunk serializer failed. {}.", spanChunk);
}
}
if (spanChunkBuffer == null) {
return new byte[0];
}
return spanChunkBuffer;
}
use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.
the class SpanStreamSendDataPlaner method toSpanChunk.
private TSpanChunk toSpanChunk(TSpan span) {
final TSpanChunk spanChunk = new TSpanChunk();
spanChunk.setSpanEventList(Collections.EMPTY_LIST);
spanChunk.setSpanEventListIsSet(true);
spanChunk.setAgentId(span.getAgentId());
spanChunk.setAgentIdIsSet(true);
spanChunk.setApplicationName(span.getApplicationName());
spanChunk.setApplicationNameIsSet(true);
spanChunk.setAgentStartTime(span.getStartTime());
spanChunk.setAgentStartTimeIsSet(true);
spanChunk.setServiceType(span.getServiceType());
spanChunk.setServiceTypeIsSet(true);
spanChunk.setTransactionId(span.getTransactionId());
spanChunk.setTransactionIdIsSet(true);
spanChunk.setSpanId(span.getSpanId());
spanChunk.setSpanIdIsSet(true);
spanChunk.setEndPoint(span.getEndPoint());
spanChunk.setEndPointIsSet(true);
return spanChunk;
}
use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.
the class SpanStreamSendDataSerializer method copySpanChunkWithoutSpanEvent.
private TSpanChunk copySpanChunkWithoutSpanEvent(TSpanChunk spanChunk) {
TSpanChunk copiedSpanChunk = spanChunk.deepCopy();
copiedSpanChunk.setSpanEventList(Collections.EMPTY_LIST);
return copiedSpanChunk;
}
use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.
the class SpanFactoryTest method testBuildSpanChunkBo.
@Test
public void testBuildSpanChunkBo() throws Exception {
TSpanChunk tSpanChunk = random.randomTSpanChunk();
TSpanEvent tSpanEvent1 = random.randomTSpanEvent((short) 0);
TSpanEvent tSpanEvent2 = random.randomTSpanEvent((short) 1);
TSpanEvent tSpanEvent3 = random.randomTSpanEvent((short) 5);
TSpanEvent tSpanEvent4 = random.randomTSpanEvent((short) 2);
tSpanChunk.setSpanEventList(Lists.newArrayList(tSpanEvent1, tSpanEvent2, tSpanEvent3, tSpanEvent4));
SpanChunkBo spanChunkBo = spanFactory.buildSpanChunkBo(tSpanChunk);
spanFactoryAssert.assertSpanChunk(tSpanChunk, spanChunkBo);
}
use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.
the class SpanEncoderTest method randomComplexSpanChunk.
public SpanChunkBo randomComplexSpanChunk() {
TSpanChunk tSpanChunk = randomTSpan.randomTSpanChunk();
TSpanEvent tSpanEvent1 = randomTSpan.randomTSpanEvent((short) 1);
TSpanEvent tSpanEvent2 = randomTSpan.randomTSpanEvent((short) 2);
TSpanEvent tSpanEvent3 = randomTSpan.randomTSpanEvent((short) 3);
TSpanEvent tSpanEvent4 = randomTSpan.randomTSpanEvent((short) 5);
tSpanChunk.setSpanEventList(newArrayList(tSpanEvent1, tSpanEvent2, tSpanEvent3, tSpanEvent4));
return spanFactory.buildSpanChunkBo(tSpanChunk);
}
Aggregations