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);
}
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;
}
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;
}
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;
}
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());
}
Aggregations