use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class AgentLifeCycleValueMapper method mapValue.
@Override
public byte[] mapValue(AgentLifeCycleBo value) {
final Buffer buffer = new AutomaticBuffer();
buffer.putInt(value.getVersion());
buffer.putPrefixedString(value.getAgentId());
buffer.putLong(value.getStartTimestamp());
buffer.putLong(value.getEventTimestamp());
buffer.putLong(value.getEventIdentifier());
buffer.putShort(value.getAgentLifeCycleState().getCode());
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class HbaseApplicationTraceIndexColumnTest method indexColumnName2.
@Test
public void indexColumnName2() {
final int elapsed = 1234;
final byte[] bytes = "thisisbytes".getBytes();
final Buffer columnName = new AutomaticBuffer(16);
columnName.putInt(elapsed);
columnName.putPrefixedBytes(bytes);
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class HbaseApplicationTraceIndexColumnTest method indexedColumnName.
@Test
public void indexedColumnName() {
final int elapsed = 1234;
final String agentId = "agentId";
final long agentStartTime = 1234567890L;
final long transactionSequence = 1234567890L;
// final Buffer buffer= new AutomaticBuffer(32);
// buffer.putPrefixedString(agentId);
// buffer.putSVar(transactionId.getAgentStartTime());
// buffer.putVar(transactionId.getTransactionSequence());
// return buffer.getBuffer();
final Buffer originalBuffer = new AutomaticBuffer(16);
originalBuffer.putVInt(elapsed);
originalBuffer.putPrefixedString(agentId);
originalBuffer.putSVLong(agentStartTime);
originalBuffer.putVLong(transactionSequence);
byte[] source = originalBuffer.getBuffer();
final Buffer fetched = new OffsetFixedBuffer(source);
Assert.assertEquals(elapsed, fetched.readVInt());
Assert.assertEquals(agentId, fetched.readPrefixedString());
Assert.assertEquals(agentStartTime, fetched.readSVLong());
Assert.assertEquals(transactionSequence, fetched.readVLong());
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer 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();
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer 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();
}
Aggregations