use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class SpanDecoderV0 method readSpan.
private SpanBo readSpan(Buffer qualifier, Buffer columnValue, SpanDecodingContext decodingContext) {
final SpanBo span = new SpanBo();
final TransactionId transactionId = decodingContext.getTransactionId();
span.setTransactionId(transactionId);
span.setCollectorAcceptTime(decodingContext.getCollectorAcceptedTime());
SpanEventBo firstSpanEvent = readQualifier(span, qualifier);
readSpanValue(columnValue, span, firstSpanEvent, decodingContext);
return span;
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class SpanDecoderV0 method readSpanChunk.
private SpanChunkBo readSpanChunk(Buffer qualifier, Buffer columnValue, SpanDecodingContext decodingContext) {
final SpanChunkBo spanChunk = new SpanChunkBo();
final TransactionId transactionId = decodingContext.getTransactionId();
spanChunk.setTransactionId(transactionId);
spanChunk.setCollectorAcceptTime(decodingContext.getCollectorAcceptedTime());
SpanEventBo firstSpanEvent = readQualifier(spanChunk, qualifier);
readSpanChunkValue(columnValue, spanChunk, firstSpanEvent, decodingContext);
return spanChunk;
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class SpanFactoryAssert method assertSpan.
public void assertSpan(TSpan tSpan, SpanBo spanBo) {
Assert.assertEquals(tSpan.getAgentId(), spanBo.getAgentId());
Assert.assertEquals(tSpan.getApplicationName(), spanBo.getApplicationId());
Assert.assertEquals(tSpan.getAgentStartTime(), spanBo.getAgentStartTime());
TransactionId transactionId = spanBo.getTransactionId();
ByteBuffer byteBuffer = TransactionIdUtils.formatByteBuffer(transactionId.getAgentId(), transactionId.getAgentStartTime(), transactionId.getTransactionSequence());
Assert.assertEquals(ByteBuffer.wrap(tSpan.getTransactionId()), byteBuffer);
Assert.assertEquals(tSpan.getSpanId(), spanBo.getSpanId());
Assert.assertEquals(tSpan.getParentSpanId(), spanBo.getParentSpanId());
Assert.assertEquals(tSpan.getStartTime(), spanBo.getStartTime());
Assert.assertEquals(tSpan.getElapsed(), spanBo.getElapsed());
Assert.assertEquals(tSpan.getElapsed(), spanBo.getElapsed());
Assert.assertEquals(tSpan.getRpc(), spanBo.getRpc());
Assert.assertEquals(tSpan.getServiceType(), spanBo.getServiceType());
Assert.assertEquals(tSpan.getEndPoint(), spanBo.getEndPoint());
Assert.assertEquals(tSpan.getRemoteAddr(), spanBo.getRemoteAddr());
assertAnnotation(tSpan.getAnnotations(), spanBo.getAnnotationBoList());
Assert.assertEquals(tSpan.getFlag(), spanBo.getFlag());
Assert.assertEquals(tSpan.getErr(), spanBo.getErrCode());
Assert.assertEquals(tSpan.getParentApplicationName(), spanBo.getParentApplicationId());
Assert.assertEquals(tSpan.getParentApplicationType(), spanBo.getParentApplicationServiceType());
Assert.assertEquals(tSpan.getAcceptorHost(), spanBo.getAcceptorHost());
Assert.assertEquals(tSpan.getApiId(), spanBo.getApiId());
Assert.assertEquals(tSpan.getApplicationServiceType(), spanBo.getApplicationServiceType());
List<SpanEventBo> spanEventBoList = spanBo.getSpanEventBoList();
List<TSpanEvent> spanEventList = tSpan.getSpanEventList();
assertSpanEventList(spanEventBoList, spanEventList);
boolean hasException = tSpan.getExceptionInfo() != null;
Assert.assertEquals(hasException, spanBo.hasException());
if (hasException) {
Assert.assertEquals(tSpan.getExceptionInfo().getIntValue(), spanBo.getExceptionId());
Assert.assertEquals(tSpan.getExceptionInfo().getStringValue(), spanBo.getExceptionMessage());
}
Assert.assertEquals(tSpan.getLoggingTransactionInfo(), spanBo.getLoggingTransactionInfo());
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class SpanFactoryAssert method assertSpanChunk.
public void assertSpanChunk(TSpanChunk tSpanChunk, SpanChunkBo spanChunkBo) {
Assert.assertEquals(tSpanChunk.getAgentId(), spanChunkBo.getAgentId());
Assert.assertEquals(tSpanChunk.getApplicationName(), spanChunkBo.getApplicationId());
Assert.assertEquals(tSpanChunk.getAgentStartTime(), spanChunkBo.getAgentStartTime());
TransactionId transactionId = spanChunkBo.getTransactionId();
ByteBuffer byteBuffer = TransactionIdUtils.formatByteBuffer(transactionId.getAgentId(), transactionId.getAgentStartTime(), transactionId.getTransactionSequence());
Assert.assertEquals(ByteBuffer.wrap(tSpanChunk.getTransactionId()), byteBuffer);
Assert.assertEquals(tSpanChunk.getSpanId(), spanChunkBo.getSpanId());
Assert.assertEquals(tSpanChunk.getServiceType(), spanChunkBo.getServiceType());
Assert.assertEquals(tSpanChunk.getEndPoint(), spanChunkBo.getEndPoint());
Assert.assertEquals(tSpanChunk.getApplicationServiceType(), spanChunkBo.getApplicationServiceType());
List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
List<TSpanEvent> spanEventList = tSpanChunk.getSpanEventList();
assertSpanEventList(spanEventBoList, spanEventList);
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class SpanFactoryTest method testTransactionId_skip_agentId.
@Test
public void testTransactionId_skip_agentId() throws Exception {
TSpan tSpan = new TSpan();
tSpan.setAgentId("agentId");
byte[] transactionIdBytes = TransactionIdUtils.formatBytes(null, 1, 2);
tSpan.setTransactionId(transactionIdBytes);
SpanBo spanBo = spanFactory.newSpanBo(tSpan);
TransactionId transactionId = spanBo.getTransactionId();
Assert.assertEquals(transactionId.getAgentId(), "agentId");
Assert.assertEquals(transactionId.getAgentStartTime(), 1);
Assert.assertEquals(transactionId.getTransactionSequence(), 2);
}
Aggregations