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 DefaultTransactionIdEncoder method newCache.
private byte[] newCache(String agentId) {
final int agentIdSize = StringUtils.getLength(agentId);
final Buffer buffer = new AutomaticBuffer(1 + 5 + agentIdSize);
buffer.putByte(VERSION);
buffer.putPrefixedString(agentId);
return buffer.copyBuffer();
}
Aggregations