Search in sources :

Example 36 with TransactionId

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

the class GrpcSpanBinder method newSpanChunkBo.

// for test
SpanChunkBo newSpanChunkBo(PSpanChunk pSpanChunk, Header header) {
    final SpanChunkBo spanChunkBo = new SpanChunkBo();
    spanChunkBo.setVersion(pSpanChunk.getVersion());
    spanChunkBo.setAgentId(header.getAgentId());
    spanChunkBo.setApplicationId(header.getApplicationName());
    spanChunkBo.setAgentStartTime(header.getAgentStartTime());
    spanChunkBo.setApplicationServiceType((short) pSpanChunk.getApplicationServiceType());
    if (pSpanChunk.hasTransactionId()) {
        PTransactionId pTransactionId = pSpanChunk.getTransactionId();
        TransactionId transactionId = newTransactionId(pTransactionId, spanChunkBo.getAgentId());
        spanChunkBo.setTransactionId(transactionId);
    } else {
        logger.warn("PTransactionId is not set {}", pSpanChunk);
        throw new IllegalStateException("PTransactionId is not set");
    }
    spanChunkBo.setKeyTime(pSpanChunk.getKeyTime());
    spanChunkBo.setSpanId(pSpanChunk.getSpanId());
    spanChunkBo.setEndPoint(pSpanChunk.getEndPoint());
    return spanChunkBo;
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) PTransactionId(com.navercorp.pinpoint.grpc.trace.PTransactionId) PTransactionId(com.navercorp.pinpoint.grpc.trace.PTransactionId) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 37 with TransactionId

use of com.navercorp.pinpoint.common.profiler.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());
    readQualifier(span, qualifier);
    readSpanValue(columnValue, span, decodingContext);
    return span;
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 38 with TransactionId

use of com.navercorp.pinpoint.common.profiler.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());
    readQualifier(spanChunk, qualifier);
    readSpanChunkValue(columnValue, spanChunk, decodingContext);
    return spanChunk;
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 39 with TransactionId

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

the class DotSerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    TransactionId transactionId = TransactionIdUtils.parseTransactionId("aigw.dev.1^1395798795017^1527177");
    Dot dot = new Dot(transactionId, 100, 99, 1, "agent");
    String jsonValue = mapper.writeValueAsString(dot);
    Assert.assertEquals("[100,99,\"aigw.dev.1^1395798795017^1527177\",0]", jsonValue);
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) Test(org.junit.Test)

Example 40 with TransactionId

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

the class ScatterDataTest method addDotTest3.

@Test
public void addDotTest3() {
    long from = 1000;
    long to = 10000;
    int xGroupUnit = 100;
    int yGroupUnit = 100;
    ScatterDataBuilder builder = new ScatterDataBuilder(from, to, xGroupUnit, yGroupUnit);
    long currentTime = System.currentTimeMillis();
    TransactionId transactionId = new TransactionId(transactionAgentId, currentTime, 1);
    long acceptedTime = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
    int executionTime = (int) Math.abs(ThreadLocalRandom.current().nextLong(60 * 1000));
    long acceptedTime2 = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
    Dot dot1 = new Dot(transactionId, acceptedTime2, executionTime, 0, agentId);
    Dot dot2 = new Dot(transactionId, acceptedTime2, executionTime, 0, agentId);
    builder.addDot(dot1);
    builder.addDot(dot2);
    List<Dot> dots = extractDotList(builder.build());
    Assert.assertEquals(2, dots.size());
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) Test(org.junit.Test)

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