Search in sources :

Example 1 with SpanBo

use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.

the class SpanSerializerV2 method serialize.

@Override
public void serialize(SpanBo spanBo, Put put, SerializationContext context) {
    final SpanEncodingContext<SpanBo> encodingContext = new SpanEncodingContext<SpanBo>(spanBo);
    ByteBuffer qualifier = spanEncoder.encodeSpanQualifier(encodingContext);
    ByteBuffer columnValue = spanEncoder.encodeSpanColumnValue(encodingContext);
    long acceptedTime = put.getTimeStamp();
    put.addColumn(TRACE_V2_CF_SPAN, qualifier, acceptedTime, columnValue);
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) ByteBuffer(java.nio.ByteBuffer)

Example 2 with SpanBo

use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.

the class SpanDecoder method decodeSpanBo.

public SpanBo decodeSpanBo(Buffer qualifier, Buffer valueBuffer, SpanDecodingContext decodingContext) {
    TransactionId transactionId = decodingContext.getTransactionId();
    SpanBo spanBo = new SpanBo();
    spanBo.setTransactionId(transactionId);
    long spanId = qualifier.readLong();
    spanBo.setSpanId(spanId);
    spanBo.setCollectorAcceptTime(decodingContext.getCollectorAcceptedTime());
    readSpan(spanBo, valueBuffer);
    if (logger.isDebugEnabled()) {
        logger.debug("read span :{}", spanBo);
    }
    return spanBo;
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 3 with SpanBo

use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.

the class AcceptUrlFilterTest method acceptTest_2.

@Test
public void acceptTest_2() {
    AcceptUrlFilter filter = new AcceptUrlFilter(encode("/abc/*"));
    SpanBo spanBo = new SpanBo();
    spanBo.setRpc("/test");
    Assert.assertFalse(filter.accept(Arrays.asList(spanBo)));
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) Test(org.junit.Test)

Example 4 with SpanBo

use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.

the class CallTreeTest method makeSpanAlign.

private SpanAlign makeSpanAlign(long startTime, int elapsed) {
    SpanBo span = new SpanBo();
    span.setStartTime(startTime);
    span.setElapsed(elapsed);
    return new SpanAlign(span);
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo)

Example 5 with SpanBo

use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.

the class SpanIdMatcherTest method testApproximateMatchMinus.

@Test
public void testApproximateMatchMinus() throws Exception {
    List<SpanBo> matchSpanList = new ArrayList<SpanBo>();
    SpanBo spanBo1 = new SpanBo();
    spanBo1.setStartTime(99);
    matchSpanList.add(spanBo1);
    SpanBo spanBo2 = new SpanBo();
    spanBo2.setStartTime(110);
    matchSpanList.add(spanBo2);
    SpanIdMatcher spanIdMatcher = new SpanIdMatcher(matchSpanList);
    SpanBo match = spanIdMatcher.approximateMatch(100);
    Assert.assertTrue(match == spanBo2);
    Assert.assertEquals(1, spanIdMatcher.other().size());
    Assert.assertTrue(spanBo1 == spanIdMatcher.other().get(0));
}
Also used : ArrayList(java.util.ArrayList) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) Test(org.junit.Test)

Aggregations

SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)65 Test (org.junit.Test)32 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)14 ArrayList (java.util.ArrayList)10 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)8 TransactionId (com.navercorp.pinpoint.common.util.TransactionId)8 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)7 ByteBuffer (java.nio.ByteBuffer)7 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)5 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)4 BasePinpointTest (com.navercorp.pinpoint.test.junit4.BasePinpointTest)4 IsRootSpan (com.navercorp.pinpoint.test.junit4.IsRootSpan)4 List (java.util.List)4 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)2 SpanDecodingContext (com.navercorp.pinpoint.common.server.bo.serializer.trace.v2.SpanDecodingContext)2 Application (com.navercorp.pinpoint.web.vo.Application)2 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)2 Cell (org.apache.hadoop.hbase.Cell)2 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)1 SpanDecodingContext (com.navercorp.pinpoint.common.server.bo.serializer.trace.v1.SpanDecodingContext)1