use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class TransactionIdComparatorTest method diffAgentStartTimeDesc.
@Test
public void diffAgentStartTimeDesc() {
TransactionId id1 = new TransactionId("A1", 2, 1);
TransactionId id2 = new TransactionId("A1", 1, 1);
Assert.assertEquals(1, comparator.compare(id1, id2));
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class TransactionIdComparatorTest method diffAgentStartTimeAsc.
@Test
public void diffAgentStartTimeAsc() {
TransactionId id1 = new TransactionId("A1", 1, 1);
TransactionId id2 = new TransactionId("A1", 2, 1);
Assert.assertEquals(-1, comparator.compare(id1, id2));
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class TransactionIdComparatorTest method sameAll.
@Test
public void sameAll() {
TransactionId id1 = new TransactionId("A1", 1, 1);
TransactionId id2 = new TransactionId("A1", 1, 1);
Assert.assertEquals(0, comparator.compare(id1, id2));
}
use of com.navercorp.pinpoint.common.profiler.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.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.profiler.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());
}
Aggregations