use of com.navercorp.pinpoint.profiler.context.id.TraceRoot in project pinpoint by naver.
the class DefaultTransactionIdEncoderTest method testDuplicateAgentId.
@Test
public void testDuplicateAgentId() {
TraceRoot traceRoot = getDuplicateAgentId();
TraceId traceId = traceRoot.getTraceId();
ByteBuffer encodeTxId = transactionIdEncoder.encodeTransactionId(traceId);
byte[] transactionId = Arrays.copyOf(encodeTxId.array(), encodeTxId.remaining());
TransactionId parsedTxId = TransactionIdUtils.parseTransactionId(transactionId, DEFAULT_AGENT_ID);
logger.debug("transactionId:{}", parsedTxId);
Assert.assertEquals(DEFAULT_AGENT_ID, parsedTxId.getAgentId());
Assert.assertEquals(parsedTxId.getAgentStartTime(), agentStartTime2);
Assert.assertEquals(parsedTxId.getTransactionSequence(), transactionId2);
}
use of com.navercorp.pinpoint.profiler.context.id.TraceRoot in project pinpoint by naver.
the class GrpcSpanProcessorV2Test method newSpan.
private Span newSpan() {
TraceId traceId = new DefaultTraceId("agent", 1, 0);
TraceRoot traceRoot = new DefaultTraceRoot(traceId, "agent", 0, 3);
return new Span(traceRoot);
}
use of com.navercorp.pinpoint.profiler.context.id.TraceRoot 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);
}
use of com.navercorp.pinpoint.profiler.context.id.TraceRoot in project pinpoint by naver.
the class DefaultSpanRecorder method recordLogging.
@Override
public void recordLogging(LoggingInfo loggingInfo) {
final TraceRoot traceRoot = span.getTraceRoot();
traceRoot.getShared().setLoggingInfo(loggingInfo.getCode());
}
use of com.navercorp.pinpoint.profiler.context.id.TraceRoot in project pinpoint by naver.
the class WrappedSpanEventRecorder method recordNextAsyncContext.
@Override
public AsyncContext recordNextAsyncContext() {
final TraceRoot traceRoot = this.traceRoot;
final AsyncId asyncIdObject = getNextAsyncId();
// sequence or stack overflow
final boolean canSampled = isOverflowState();
return asyncContextFactory.newAsyncContext(traceRoot, asyncIdObject, canSampled);
}
Aggregations