Search in sources :

Example 1 with PartitionedByteBufferLocator

use of com.navercorp.pinpoint.profiler.sender.PartitionedByteBufferLocator 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());
}
Also used : SpanStreamSendDataFactory(com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataFactory) SpanStreamSendDataSerializer(com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataSerializer) HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) Span(com.navercorp.pinpoint.profiler.context.Span) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) PartitionedByteBufferLocator(com.navercorp.pinpoint.profiler.sender.PartitionedByteBufferLocator) Test(org.junit.Test)

Example 2 with PartitionedByteBufferLocator

use of com.navercorp.pinpoint.profiler.sender.PartitionedByteBufferLocator 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());
}
Also used : SpanStreamSendDataFactory(com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataFactory) SpanStreamSendDataSerializer(com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataSerializer) HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory) SpanChunk(com.navercorp.pinpoint.profiler.context.SpanChunk) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) PartitionedByteBufferLocator(com.navercorp.pinpoint.profiler.sender.PartitionedByteBufferLocator) Test(org.junit.Test)

Aggregations

SpanEvent (com.navercorp.pinpoint.profiler.context.SpanEvent)2 PartitionedByteBufferLocator (com.navercorp.pinpoint.profiler.sender.PartitionedByteBufferLocator)2 SpanStreamSendDataFactory (com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataFactory)2 SpanStreamSendDataSerializer (com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataSerializer)2 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)2 HeaderTBaseSerializerFactory (com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory)2 Test (org.junit.Test)2 Span (com.navercorp.pinpoint.profiler.context.Span)1 SpanChunk (com.navercorp.pinpoint.profiler.context.SpanChunk)1