Search in sources :

Example 1 with BasicSpan

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

the class SpanEventSerializer method writeQualifier.

private ByteBuffer writeQualifier(SpanEventEncodingContext spanEventEncodingContext) {
    SpanEventBo spanEventBo = spanEventEncodingContext.getSpanEventBo();
    BasicSpan basicSpan = spanEventEncodingContext.getBasicSpan();
    final Buffer rowId = new AutomaticBuffer();
    rowId.putLong(basicSpan.getSpanId());
    rowId.putShort(spanEventBo.getSequence());
    rowId.putInt(spanEventBo.getAsyncId());
    rowId.putShort(spanEventBo.getAsyncSequence());
    return rowId.wrapByteBuffer();
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) ByteBuffer(java.nio.ByteBuffer) BasicSpan(com.navercorp.pinpoint.common.server.bo.BasicSpan) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Example 2 with BasicSpan

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

the class SpanEventSerializer method writeValue.

public ByteBuffer writeValue(SpanEventEncodingContext spanEventEncodingContext) {
    SpanEventBo spanEventBo = spanEventEncodingContext.getSpanEventBo();
    BasicSpan basicSpan = spanEventEncodingContext.getBasicSpan();
    final Buffer buffer = new AutomaticBuffer(512);
    buffer.putByte(spanEventBo.getVersion());
    buffer.putPrefixedString(basicSpan.getAgentId());
    buffer.putPrefixedString(basicSpan.getApplicationId());
    buffer.putVLong(basicSpan.getAgentStartTime());
    buffer.putVInt(spanEventBo.getStartElapsed());
    buffer.putVInt(spanEventBo.getEndElapsed());
    // don't need to put sequence because it is set at Qualifier
    // buffer.put(sequence);
    buffer.putPrefixedString(spanEventBo.getRpc());
    buffer.putShort(spanEventBo.getServiceType());
    buffer.putPrefixedString(spanEventBo.getEndPoint());
    buffer.putPrefixedString(spanEventBo.getDestinationId());
    buffer.putSVInt(spanEventBo.getApiId());
    buffer.putSVInt(spanEventBo.getDepth());
    buffer.putLong(spanEventBo.getNextSpanId());
    if (spanEventBo.hasException()) {
        buffer.putBoolean(true);
        buffer.putSVInt(spanEventBo.getExceptionId());
        buffer.putPrefixedString(spanEventBo.getExceptionMessage());
    } else {
        buffer.putBoolean(false);
    }
    final List<AnnotationBo> annotationBoList = spanEventBo.getAnnotationBoList();
    this.annotationSerializer.writeAnnotationList(annotationBoList, buffer);
    buffer.putSVInt(spanEventBo.getNextAsyncId());
    return buffer.wrapByteBuffer();
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) ByteBuffer(java.nio.ByteBuffer) AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) BasicSpan(com.navercorp.pinpoint.common.server.bo.BasicSpan) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Aggregations

AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)2 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)2 BasicSpan (com.navercorp.pinpoint.common.server.bo.BasicSpan)2 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)2 ByteBuffer (java.nio.ByteBuffer)2 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)1