use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method encodeIntStringValue.
private byte[] encodeIntStringValue(Object value) {
final TIntStringValue tIntStringValue = (TIntStringValue) value;
final int intValue = tIntStringValue.getIntValue();
final byte[] stringValue = BytesUtils.toBytes(tIntStringValue.getStringValue());
// TODO increase by a more precise value
final int bufferSize = getBufferSize(stringValue, 4 + 8);
final Buffer buffer = new AutomaticBuffer(bufferSize);
buffer.putSVInt(intValue);
buffer.putPrefixedBytes(stringValue);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method encodeIntStringStringValue.
private byte[] encodeIntStringStringValue(Object o) {
final TIntStringStringValue tIntStringStringValue = (TIntStringStringValue) o;
final int intValue = tIntStringStringValue.getIntValue();
final byte[] stringValue1 = BytesUtils.toBytes(tIntStringStringValue.getStringValue1());
final byte[] stringValue2 = BytesUtils.toBytes(tIntStringStringValue.getStringValue2());
// TODO increase by a more precise value
final int bufferSize = getBufferSize(stringValue1, stringValue2, 4 + 8);
final Buffer buffer = new AutomaticBuffer(bufferSize);
buffer.putSVInt(intValue);
buffer.putPrefixedBytes(stringValue1);
buffer.putPrefixedBytes(stringValue2);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class HbaseApplicationTraceIndexDao method insert.
@Override
public void insert(final TSpan span) {
if (span == null) {
throw new NullPointerException("span must not be null");
}
final Buffer buffer = new AutomaticBuffer(10 + AGENT_NAME_MAX_LEN);
buffer.putVInt(span.getElapsed());
buffer.putSVInt(span.getErr());
buffer.putPrefixedString(span.getAgentId());
final byte[] value = buffer.getBuffer();
long acceptedTime = acceptedTimeService.getAcceptedTime();
final byte[] distributedKey = createRowKey(span, acceptedTime);
Put put = new Put(distributedKey);
put.addColumn(APPLICATION_TRACE_INDEX_CF_TRACE, makeQualifier(span), acceptedTime, value);
boolean success = hbaseTemplate.asyncPut(APPLICATION_TRACE_INDEX, put);
if (!success) {
hbaseTemplate.put(APPLICATION_TRACE_INDEX, put);
}
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class ActiveTraceHistogramBo method writeValue.
public byte[] writeValue() {
final Buffer buffer = new AutomaticBuffer();
buffer.putByte(this.version);
buffer.putVInt(this.histogramSchemaType);
int version = this.version & 0xFF;
switch(version) {
case 0:
buffer.putVInt(this.activeTraceCountMap.size());
buffer.putVInt(this.activeTraceCountMap.get(SlotType.FAST));
buffer.putVInt(this.activeTraceCountMap.get(SlotType.NORMAL));
buffer.putVInt(this.activeTraceCountMap.get(SlotType.SLOW));
buffer.putVInt(this.activeTraceCountMap.get(SlotType.VERY_SLOW));
break;
default:
break;
}
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AgentStatMemoryGcBo method writeValue.
public byte[] writeValue() {
final Buffer buffer = new AutomaticBuffer();
buffer.putPrefixedString(this.agentId);
buffer.putLong(this.startTimestamp);
buffer.putLong(this.timestamp);
buffer.putPrefixedString(this.gcType);
buffer.putLong(this.jvmMemoryHeapUsed);
buffer.putLong(this.jvmMemoryHeapMax);
buffer.putLong(this.jvmMemoryNonHeapUsed);
buffer.putLong(this.jvmMemoryNonHeapMax);
buffer.putLong(this.jvmGcOldCount);
buffer.putLong(this.jvmGcOldTime);
return buffer.getBuffer();
}
Aggregations