use of com.navercorp.pinpoint.thrift.dto.TSpanEvent in project pinpoint by naver.
the class SpanStreamSendDataPlanerTest method getSpanEventList.
private List<TSpanEvent> getSpanEventList(PartitionedByteBufferLocator partitionedByteBufferLocator, SpanStreamSendDataFactory factory) throws Exception {
List<TSpanEvent> spanEventList = new ArrayList<TSpanEvent>();
SpanChunkStreamSendDataPlaner planer = new SpanChunkStreamSendDataPlaner(partitionedByteBufferLocator, factory);
Iterator<SpanStreamSendData> iterator = planer.getSendDataIterator();
while (iterator.hasNext()) {
SpanStreamSendData data = iterator.next();
ByteBuffer[] sendBuffers = data.getSendBuffers();
byte[] relatedBuffer = getSpanRelatedBuffer(sendBuffers);
List<TSpanEvent> result = deserialize(relatedBuffer);
for (TSpanEvent spanEvent : result) {
spanEventList.add(spanEvent);
}
}
return spanEventList;
}
use of com.navercorp.pinpoint.thrift.dto.TSpanEvent in project pinpoint by naver.
the class ReplaceListCompactProtocolTest method before.
@Before
public void before() {
// add dummy span-event list
List<TSpanEvent> spanEventList = new ArrayList<TSpanEvent>();
spanEventList.add(new TSpanEvent());
span.setSpanEventList(spanEventList);
span.setSpanEventListIsSet(true);
// init byte buffer
Arrays.fill(buf, Byte.valueOf("0"));
}
use of com.navercorp.pinpoint.thrift.dto.TSpanEvent in project pinpoint by naver.
the class TBaseStreamTest method newSpanChunk.
public TSpanChunk newSpanChunk() {
final TSpanChunk spanChunk = new TSpanChunk();
spanChunk.setAgentId(AGENT_ID);
spanChunk.setAgentIdIsSet(true);
spanChunk.setApplicationName(APPLICATION_NAME);
spanChunk.setApplicationNameIsSet(true);
spanChunk.setAgentStartTime(START_TIME);
spanChunk.setAgentStartTimeIsSet(true);
spanChunk.setServiceType(SERVICE_TYPE);
spanChunk.setServiceTypeIsSet(true);
spanChunk.setTransactionId(TRANSACTION_ID);
spanChunk.setTransactionIdIsSet(true);
spanChunk.setSpanId(1);
spanChunk.setSpanIdIsSet(true);
List<TSpanEvent> list = new ArrayList<TSpanEvent>();
list.add(newSpanEvent());
list.add(newSpanEvent());
list.add(newSpanEvent());
spanChunk.setSpanEventList(list);
spanChunk.setSpanEventListIsSet(true);
return spanChunk;
}
use of com.navercorp.pinpoint.thrift.dto.TSpanEvent in project pinpoint by naver.
the class TBaseStreamTest method write.
@Test
public void write() throws Exception {
TBaseStream stream = new TBaseStream(DEFAULT_PROTOCOL_FACTORY);
// single span event
TSpanEvent spanEvent = newSpanEvent();
stream.write(spanEvent);
int size = stream.size();
// append
stream.write(spanEvent);
assertEquals(size * 2, stream.size());
}
use of com.navercorp.pinpoint.thrift.dto.TSpanEvent in project pinpoint by naver.
the class TSpanMockBuilder method buildEvent.
public TSpanEvent buildEvent(int size) {
TSpanEvent spanEvent = new TSpanEvent();
spanEvent.setApiId(1);
spanEvent.setApiIdIsSet(true);
spanEvent.setDepth(1);
spanEvent.setDepthIsSet(true);
byte[] buffer = new byte[size];
Arrays.fill(buffer, (byte) 1);
spanEvent.setDestinationId(new String(buffer));
spanEvent.setDestinationIdIsSet(true);
return spanEvent;
}
Aggregations