Search in sources :

Example 26 with TransactionId

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;
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 27 with TransactionId

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;
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 28 with TransactionId

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

Example 29 with TransactionId

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

Example 30 with TransactionId

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

Aggregations

TransactionId (com.navercorp.pinpoint.common.util.TransactionId)44 ArrayList (java.util.ArrayList)11 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)9 Test (org.junit.Test)9 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)8 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)8 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)7 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)5 List (java.util.List)5 Put (org.apache.hadoop.hbase.client.Put)4 ByteBuffer (java.nio.ByteBuffer)3 Cell (org.apache.hadoop.hbase.Cell)3 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)2 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)2 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)2 LimitedScanResult (com.navercorp.pinpoint.web.vo.LimitedScanResult)2 Get (org.apache.hadoop.hbase.client.Get)2 Scan (org.apache.hadoop.hbase.client.Scan)2 FilterList (org.apache.hadoop.hbase.filter.FilterList)2