use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanChunkStreamSendDataPlanerTest method createSpanEventList.
private List<SpanEvent> createSpanEventList(int size) throws InterruptedException {
Span span = new Span();
List<SpanEvent> spanEventList = new ArrayList<SpanEvent>(size);
for (int i = 0; i < size; i++) {
SpanEvent spanEvent = new SpanEvent(span);
spanEvent.markStartTime();
Thread.sleep(1);
spanEvent.markAfterTime();
spanEventList.add(spanEvent);
}
return spanEventList;
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanStreamSendDataPlanerTest method createSpanEventList.
private List<SpanEvent> createSpanEventList(int size) throws InterruptedException {
Span span = new Span();
List<SpanEvent> spanEventList = new ArrayList<SpanEvent>(size);
for (int i = 0; i < size; i++) {
SpanEvent spanEvent = new SpanEvent(span);
spanEvent.markStartTime();
Thread.sleep(1);
spanEvent.markAfterTime();
spanEventList.add(spanEvent);
}
return spanEventList;
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanStreamSendDataPlanerTest method spanStreamSendDataPlanerTest.
@Test
public void spanStreamSendDataPlanerTest() throws Exception {
int spanEventSize = 10;
SpanStreamSendDataSerializer serializer = new SpanStreamSendDataSerializer();
HeaderTBaseSerializerFactory headerTBaseSerializerFactory = new HeaderTBaseSerializerFactory();
List<SpanEvent> originalSpanEventList = createSpanEventList(spanEventSize);
Span span = createSpan(originalSpanEventList);
PartitionedByteBufferLocator partitionedByteBufferLocator = serializer.serializeSpanStream(headerTBaseSerializerFactory.createSerializer(), span);
SpanStreamSendDataFactory factory = new SpanStreamSendDataFactory(100, 50, objectPool);
List<TSpanEvent> spanEventList = getSpanEventList(partitionedByteBufferLocator, factory);
partitionedByteBufferLocator = serializer.serializeSpanStream(headerTBaseSerializerFactory.createSerializer(), span);
factory = new SpanStreamSendDataFactory(objectPool);
List<TSpanEvent> spanEventList2 = getSpanEventList(partitionedByteBufferLocator, factory);
Assert.assertEquals(spanEventSize, spanEventList.size());
Assert.assertEquals(spanEventSize, spanEventList2.size());
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanStreamSendDataPlanerTest method createSpan.
private Span createSpan(List<SpanEvent> spanEventList) {
DefaultTraceId traceId = new DefaultTraceId("test", 0, 1);
Span span = new Span();
for (SpanEvent spanEvent : spanEventList) {
span.addToSpanEventList(spanEvent);
}
span.setAgentId("agentId");
span.recordTraceId(traceId);
return span;
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanStreamUDPSenderTest method createSpan.
private Span createSpan(int spanEventSize) throws InterruptedException {
List<SpanEvent> spanEventList = createSpanEventList(spanEventSize);
Span span = new Span();
List<TSpanEvent> tSpanEventList = new ArrayList<>();
for (SpanEvent spanEvent : spanEventList) {
tSpanEventList.add(spanEvent);
}
span.setSpanEventList(tSpanEventList);
return span;
}
Aggregations