Search in sources :

Example 21 with TSpanChunk

use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.

the class SpanFactoryTest method testBuildSpanChunkBo.

@Test
public void testBuildSpanChunkBo() {
    TSpanChunk tSpanChunk = random.randomTSpanChunk();
    TSpanEvent tSpanEvent1 = random.randomTSpanEvent((short) 0);
    TSpanEvent tSpanEvent2 = random.randomTSpanEvent((short) 1);
    TSpanEvent tSpanEvent3 = random.randomTSpanEvent((short) 5);
    TSpanEvent tSpanEvent4 = random.randomTSpanEvent((short) 2);
    tSpanChunk.setSpanEventList(Arrays.asList(tSpanEvent1, tSpanEvent2, tSpanEvent3, tSpanEvent4));
    SpanChunkBo spanChunkBo = spanFactory.buildSpanChunkBo(tSpanChunk);
    spanFactoryAssert.assertSpanChunk(tSpanChunk, spanChunkBo);
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) Test(org.junit.Test)

Example 22 with TSpanChunk

use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.

the class RandomTSpan method randomTSpanChunk.

public TSpanChunk randomTSpanChunk() {
    final TSpanChunk tSpanChunk = new TSpanChunk();
    tSpanChunk.setAgentId("agentId");
    tSpanChunk.setApplicationName("appName");
    tSpanChunk.setAgentStartTime(System.currentTimeMillis());
    tSpanChunk.setTransactionId(TransactionIdUtils.formatByteBuffer("agent", System.currentTimeMillis(), RandomUtils.nextLong(0, Long.MAX_VALUE)));
    tSpanChunk.setSpanId(random.nextLong());
    tSpanChunk.setEndPoint(RandomStringUtils.random(20));
    // tSpanChunk.setSpanEventList()
    tSpanChunk.setApplicationServiceType(randomServerServiceType());
    return tSpanChunk;
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk)

Example 23 with TSpanChunk

use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.

the class TBaseStreamTest method newSpanChunk.

public TSpanChunk newSpanChunk() {
    final TSpanChunk spanChunk = new TSpanChunk();
    spanChunk.setAgentId(AGENT_ID);
    spanChunk.setAgentIdIsSet(true);
    spanChunk.setApplicationName(APPLICATION_NAME);
    spanChunk.setApplicationNameIsSet(true);
    spanChunk.setAgentStartTime(START_TIME);
    spanChunk.setAgentStartTimeIsSet(true);
    spanChunk.setServiceType(SERVICE_TYPE);
    spanChunk.setServiceTypeIsSet(true);
    spanChunk.setTransactionId(TRANSACTION_ID);
    spanChunk.setTransactionIdIsSet(true);
    spanChunk.setSpanId(1);
    spanChunk.setSpanIdIsSet(true);
    List<TSpanEvent> list = new ArrayList<TSpanEvent>();
    list.add(newSpanEvent());
    list.add(newSpanEvent());
    list.add(newSpanEvent());
    spanChunk.setSpanEventList(list);
    spanChunk.setSpanEventListIsSet(true);
    return spanChunk;
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) ArrayList(java.util.ArrayList) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent)

Example 24 with TSpanChunk

use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.

the class TSpanMockBuilder method buildChunk.

public TSpanChunk buildChunk(int spanEventCount, int spanEventSize) {
    final TSpanChunk spanChunk = new TSpanChunk();
    spanChunk.setAgentId(agentId);
    spanChunk.setAgentIdIsSet(true);
    spanChunk.setApplicationName(applicationName);
    spanChunk.setApplicationNameIsSet(true);
    spanChunk.setAgentStartTime(startTime);
    spanChunk.setAgentStartTimeIsSet(true);
    spanChunk.setServiceType(serviceType);
    spanChunk.setServiceTypeIsSet(true);
    spanChunk.setTransactionId(transactionId);
    spanChunk.setTransactionIdIsSet(true);
    spanChunk.setSpanId(1);
    spanChunk.setSpanIdIsSet(true);
    for (int i = 0; i < spanEventCount; i++) {
        spanChunk.addToSpanEventList(buildEvent(spanEventSize));
        spanChunk.setSpanEventListIsSet(true);
    }
    return spanChunk;
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk)

Example 25 with TSpanChunk

use of com.navercorp.pinpoint.thrift.dto.TSpanChunk in project pinpoint by naver.

the class SpanThriftMessageConverterTest method buildTSpanChunk.

@Test
public void buildTSpanChunk() {
    final SpanChunk spanChunk = newSpanChunk();
    TraceRoot traceRoot = spanChunk.getTraceRoot();
    TSpanChunk tSpanChunk = messageConverter.buildTSpanChunk(spanChunk);
    Assert.assertEquals(traceRoot.getTraceId().getSpanId(), tSpanChunk.getSpanId());
    Assert.assertEquals(traceRoot.getShared().getEndPoint(), tSpanChunk.getEndPoint());
}
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) DefaultTraceRoot(com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot) TraceRoot(com.navercorp.pinpoint.profiler.context.id.TraceRoot) Test(org.junit.Test)

Aggregations

TSpanChunk (com.navercorp.pinpoint.thrift.dto.TSpanChunk)26 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)14 Test (org.junit.Test)13 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)5 SpanChunk (com.navercorp.pinpoint.profiler.context.SpanChunk)4 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)4 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 LocalAsyncIdBo (com.navercorp.pinpoint.common.server.bo.LocalAsyncIdBo)2 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)2 ArrayList (java.util.ArrayList)2 TBase (org.apache.thrift.TBase)2 TypeLiteral (com.google.inject.TypeLiteral)1 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)1 VisibleForTesting (com.navercorp.pinpoint.common.annotations.VisibleForTesting)1 Message (com.navercorp.pinpoint.io.request.Message)1 AsyncSpanChunk (com.navercorp.pinpoint.profiler.context.AsyncSpanChunk)1 LocalAsyncId (com.navercorp.pinpoint.profiler.context.LocalAsyncId)1 SpanType (com.navercorp.pinpoint.profiler.context.SpanType)1