Search in sources :

Example 1 with DefaultSpanChunk

use of com.navercorp.pinpoint.profiler.context.DefaultSpanChunk in project pinpoint by naver.

the class SpanThriftMessageConverterTest method newSpanChunk.

private SpanChunk newSpanChunk() {
    final TraceId traceId = new DefaultTraceId(AGENT_ID, AGENT_START_TIME, 1L);
    final TraceRoot traceRoot = new DefaultTraceRoot(traceId, AGENT_ID, AGENT_START_TIME, 100L);
    return new DefaultSpanChunk(traceRoot, Arrays.asList(new SpanEvent()));
}
Also used : DefaultTraceId(com.navercorp.pinpoint.profiler.context.id.DefaultTraceId) DefaultTraceRoot(com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TraceId(com.navercorp.pinpoint.bootstrap.context.TraceId) DefaultTraceId(com.navercorp.pinpoint.profiler.context.id.DefaultTraceId) DefaultTraceRoot(com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot) TraceRoot(com.navercorp.pinpoint.profiler.context.id.TraceRoot) DefaultSpanChunk(com.navercorp.pinpoint.profiler.context.DefaultSpanChunk)

Example 2 with DefaultSpanChunk

use of com.navercorp.pinpoint.profiler.context.DefaultSpanChunk in project pinpoint by naver.

the class SpanPostProcessorTest method postProcess1.

@Test
public void postProcess1() {
    SpanProcessor<TSpan, TSpanChunk> spanChunkPostProcessor = new SpanProcessorV1();
    TraceRoot internalTraceId = newInternalTraceId();
    TSpanChunk tSpanChunk = new TSpanChunk();
    try {
        SpanChunk spanChunk = new DefaultSpanChunk(internalTraceId, new ArrayList<SpanEvent>());
        spanChunkPostProcessor.postProcess(spanChunk, tSpanChunk);
        Assert.fail();
    } catch (Exception ignored) {
    }
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) DefaultSpanChunk(com.navercorp.pinpoint.profiler.context.DefaultSpanChunk) SpanChunk(com.navercorp.pinpoint.profiler.context.SpanChunk) TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TSpan(com.navercorp.pinpoint.thrift.dto.TSpan) DefaultTraceRoot(com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot) TraceRoot(com.navercorp.pinpoint.profiler.context.id.TraceRoot) DefaultSpanChunk(com.navercorp.pinpoint.profiler.context.DefaultSpanChunk) Test(org.junit.Test)

Example 3 with DefaultSpanChunk

use of com.navercorp.pinpoint.profiler.context.DefaultSpanChunk in project pinpoint by naver.

the class SpanPostProcessorTest method postProcess2.

@Test
public void postProcess2() {
    SpanProcessor<TSpan, TSpanChunk> spanChunkPostProcessor = new SpanProcessorV1();
    TraceRoot internalTraceId = newInternalTraceId();
    List<TSpanEvent> tSpanEvents = new ArrayList<TSpanEvent>();
    TSpanChunk tSpanChunk = new TSpanChunk();
    tSpanChunk.setSpanEventList(tSpanEvents);
    List<SpanEvent> spanEvents = new ArrayList<SpanEvent>();
    SpanChunk spanChunk = new DefaultSpanChunk(internalTraceId, spanEvents);
    // one spanEvent
    addSpanEvent(tSpanEvents, spanEvents);
    spanChunkPostProcessor.postProcess(spanChunk, tSpanChunk);
    // two spanEvent
    addSpanEvent(tSpanEvents, spanEvents);
    spanChunkPostProcessor.postProcess(spanChunk, tSpanChunk);
    // three
    addSpanEvent(tSpanEvents, spanEvents);
    spanChunkPostProcessor.postProcess(spanChunk, tSpanChunk);
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) DefaultSpanChunk(com.navercorp.pinpoint.profiler.context.DefaultSpanChunk) SpanChunk(com.navercorp.pinpoint.profiler.context.SpanChunk) TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) ArrayList(java.util.ArrayList) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TSpan(com.navercorp.pinpoint.thrift.dto.TSpan) DefaultTraceRoot(com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot) TraceRoot(com.navercorp.pinpoint.profiler.context.id.TraceRoot) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) DefaultSpanChunk(com.navercorp.pinpoint.profiler.context.DefaultSpanChunk) Test(org.junit.Test)

Aggregations

DefaultSpanChunk (com.navercorp.pinpoint.profiler.context.DefaultSpanChunk)3 SpanEvent (com.navercorp.pinpoint.profiler.context.SpanEvent)3 DefaultTraceRoot (com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot)3 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)3 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)3 SpanChunk (com.navercorp.pinpoint.profiler.context.SpanChunk)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)2 TSpanChunk (com.navercorp.pinpoint.thrift.dto.TSpanChunk)2 Test (org.junit.Test)2 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)1 DefaultTraceId (com.navercorp.pinpoint.profiler.context.id.DefaultTraceId)1 ArrayList (java.util.ArrayList)1