Search in sources :

Example 26 with TransactionId

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));
}
Also used : TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) Test(org.junit.Test)

Example 27 with TransactionId

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));
}
Also used : TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) Test(org.junit.Test)

Example 28 with TransactionId

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));
}
Also used : TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) Test(org.junit.Test)

Example 29 with TransactionId

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);
}
Also used : ByteBuffer(java.nio.ByteBuffer) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 30 with TransactionId

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());
}
Also used : ByteBuffer(java.nio.ByteBuffer) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Aggregations

TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)51 Test (org.junit.Test)18 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)15 ArrayList (java.util.ArrayList)12 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)9 ByteBuffer (java.nio.ByteBuffer)6 List (java.util.List)6 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)5 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)4 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)4 DefaultTraceId (com.navercorp.pinpoint.profiler.context.id.DefaultTraceId)4 ColumnGetCount (com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount)3 DefaultTraceRoot (com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot)3 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)3 CallTreeIterator (com.navercorp.pinpoint.web.calltree.span.CallTreeIterator)3 SpanResult (com.navercorp.pinpoint.web.service.SpanResult)3 RecordSet (com.navercorp.pinpoint.web.vo.callstacks.RecordSet)3 TableName (org.apache.hadoop.hbase.TableName)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3