use of com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataSerializer 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.sender.SpanStreamSendDataSerializer in project pinpoint by naver.
the class SpanChunkStreamSendDataPlanerTest method spanChunkStreamSendDataPlanerTest.
@Test
public void spanChunkStreamSendDataPlanerTest() throws Exception {
int spanEventSize = 10;
SpanStreamSendDataSerializer serializer = new SpanStreamSendDataSerializer();
HeaderTBaseSerializerFactory headerTBaseSerializerFactory = new HeaderTBaseSerializerFactory();
List<SpanEvent> originalSpanEventList = createSpanEventList(spanEventSize);
SpanChunk spanChunk = spanChunkFactory.create(originalSpanEventList);
PartitionedByteBufferLocator partitionedByteBufferLocator = serializer.serializeSpanChunkStream(headerTBaseSerializerFactory.createSerializer(), spanChunk);
SpanStreamSendDataFactory factory = new SpanStreamSendDataFactory(100, 50, objectPool);
List<TSpanEvent> spanEventList = getSpanEventList(partitionedByteBufferLocator, factory);
partitionedByteBufferLocator = serializer.serializeSpanChunkStream(headerTBaseSerializerFactory.createSerializer(), spanChunk);
factory = new SpanStreamSendDataFactory(objectPool);
List<TSpanEvent> spanEventList2 = getSpanEventList(partitionedByteBufferLocator, factory);
Assert.assertEquals(spanEventSize, spanEventList.size());
Assert.assertEquals(spanEventSize, spanEventList2.size());
}
Aggregations