use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class OrderedSpanRecorderTest method createAsyncSpanEvent.
private SpanEvent createAsyncSpanEvent(Span associatedSpan, int startElapsed, short sequence, int asyncId) {
if (startElapsed < 0) {
throw new IllegalArgumentException("startElapsed cannot be less than 0");
}
if (sequence < 0) {
throw new IllegalArgumentException("sequence cannot be less than 0");
}
if (asyncId < 0) {
throw new IllegalArgumentException("asyncId cannot be less than 0");
}
SpanEvent event = new SpanEvent(associatedSpan);
event.setStartElapsed(startElapsed);
event.setSequence(sequence);
if (asyncId != UNSET_ASYNC_ID) {
event.setAsyncId(asyncId);
}
return event;
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent 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.SpanEvent 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.SpanEvent 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.SpanEvent 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;
}
Aggregations