Search in sources :

Example 31 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanUtils method getTransactionId.

@Deprecated
public static byte[] getTransactionId(TSpan span) {
    if (span == null) {
        throw new NullPointerException("span must not be null");
    }
    final byte[] transactionIdBytes = span.getTransactionId();
    TransactionId transactionId = TransactionIdUtils.parseTransactionId(transactionIdBytes);
    String agentId = transactionId.getAgentId();
    if (agentId == null) {
        agentId = span.getAgentId();
    }
    return BytesUtils.stringLongLongToBytes(agentId, AGENT_NAME_MAX_LEN, transactionId.getAgentStartTime(), transactionId.getTransactionSequence());
}
Also used : TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 32 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanUtils method getVarTransactionId.

public static byte[] getVarTransactionId(TSpan span) {
    if (span == null) {
        throw new NullPointerException("span must not be null");
    }
    final byte[] transactionIdBytes = span.getTransactionId();
    TransactionId transactionId = TransactionIdUtils.parseTransactionId(transactionIdBytes);
    String agentId = transactionId.getAgentId();
    if (agentId == null) {
        agentId = span.getAgentId();
    }
    final Buffer buffer = new AutomaticBuffer(32);
    buffer.putPrefixedString(agentId);
    buffer.putSVLong(transactionId.getAgentStartTime());
    buffer.putVLong(transactionId.getTransactionSequence());
    return buffer.getBuffer();
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 33 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanFactory method newTransactionId.

private TransactionId newTransactionId(byte[] transactionIdBytes, BasicSpan basicSpan) {
    final TransactionId transactionId = TransactionIdUtils.parseTransactionId(transactionIdBytes);
    String transactionAgentId = transactionId.getAgentId();
    if (transactionAgentId != null) {
        return transactionId;
    }
    String spanAgentId = basicSpan.getAgentId();
    return new TransactionId(spanAgentId, transactionId.getAgentStartTime(), transactionId.getTransactionSequence());
}
Also used : TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 34 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanFactory method newSpanChunkBo.

// for test
SpanChunkBo newSpanChunkBo(TSpanChunk tSpanChunk) {
    final SpanChunkBo spanChunkBo = new SpanChunkBo();
    spanChunkBo.setAgentId(tSpanChunk.getAgentId());
    spanChunkBo.setApplicationId(tSpanChunk.getApplicationName());
    spanChunkBo.setAgentStartTime(tSpanChunk.getAgentStartTime());
    spanChunkBo.setServiceType(tSpanChunk.getServiceType());
    if (tSpanChunk.isSetApplicationServiceType()) {
        spanChunkBo.setApplicationServiceType(tSpanChunk.getApplicationServiceType());
    } else {
        spanChunkBo.setApplicationServiceType(tSpanChunk.getServiceType());
    }
    TransactionId transactionId = newTransactionId(tSpanChunk.getTransactionId(), spanChunkBo);
    spanChunkBo.setTransactionId(transactionId);
    spanChunkBo.setSpanId(tSpanChunk.getSpanId());
    spanChunkBo.setEndPoint(tSpanChunk.getEndPoint());
    return spanChunkBo;
}
Also used : TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 35 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class TraceRowKeyEncoderV1Test method encodeRowKey.

@Test
public void encodeRowKey() throws Exception {
    TransactionId spanTransactionId = new TransactionId("traceAgentId", System.currentTimeMillis(), RandomUtils.nextLong(0, 10000));
    byte[] rowKey = traceRowKeyEncoder.encodeRowKey(spanTransactionId);
    TransactionId transactionId = traceRowKeyDecoder.decodeRowKey(rowKey);
    Assert.assertEquals(transactionId, spanTransactionId);
}
Also used : 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