use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class SpanUtils method getVarTransactionId.
public static byte[] getVarTransactionId(TSpan span) {
if (span == null) {
throw new NullPointerException("span must not be null");
}
final byte[] transactionIdBytes = span.getTransactionId();
TransactionId transactionId = TransactionIdUtils.parseTransactionId(transactionIdBytes);
String agentId = transactionId.getAgentId();
if (agentId == null) {
agentId = span.getAgentId();
}
final Buffer buffer = new AutomaticBuffer(32);
buffer.putPrefixedString(agentId);
buffer.putSVLong(transactionId.getAgentStartTime());
buffer.putVLong(transactionId.getTransactionSequence());
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class AgentInfoBo method writeValue.
public byte[] writeValue() {
final Buffer buffer = new AutomaticBuffer();
buffer.putPrefixedString(this.getHostName());
buffer.putPrefixedString(this.getIp());
buffer.putPrefixedString(this.getPorts());
buffer.putPrefixedString(this.getApplicationName());
buffer.putShort(this.getServiceTypeCode());
buffer.putInt(this.getPid());
buffer.putPrefixedString(this.getAgentVersion());
buffer.putLong(this.getStartTime());
buffer.putLong(this.getEndTimeStamp());
buffer.putInt(this.getEndStatus());
buffer.putPrefixedString(this.getVmVersion());
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class AgentStatCpuLoadBo method writeValue.
public byte[] writeValue() {
final Buffer buffer = new AutomaticBuffer();
buffer.putPrefixedString(this.agentId);
buffer.putLong(this.startTimestamp);
buffer.putLong(this.timestamp);
buffer.putDouble(this.jvmCpuLoad);
buffer.putDouble(this.systemCpuLoad);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class ServerMetaDataBo method writeValue.
public byte[] writeValue() {
final Buffer buffer = new AutomaticBuffer();
buffer.put2PrefixedString(this.serverInfo);
final int numVmArgs = this.vmArgs == null ? 0 : this.vmArgs.size();
buffer.putVInt(numVmArgs);
if (this.vmArgs != null) {
for (String vmArg : this.vmArgs) {
buffer.put2PrefixedString(vmArg);
}
}
final int numServiceInfos = this.serviceInfos == null ? 0 : this.serviceInfos.size();
buffer.putVInt(numServiceInfos);
if (this.serviceInfos != null) {
for (ServiceInfoBo serviceInfo : this.serviceInfos) {
buffer.putPrefixedBytes(serviceInfo.writeValue());
}
}
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.
the class EncodingStrategyTestBase method getBufferSizes.
private Map<EncodingStrategy<T>, Integer> getBufferSizes(List<T> values) {
Map<EncodingStrategy<T>, Integer> bufferSizes = new HashMap<EncodingStrategy<T>, Integer>();
for (EncodingStrategy<T> strategy : getEncodingStrategies()) {
Buffer encodedBuffer = new AutomaticBuffer();
codec.encodeValues(encodedBuffer, strategy, values);
int encodedBufferSize = encodedBuffer.getBuffer().length;
bufferSizes.put(strategy, encodedBufferSize);
}
logger.debug("Strategies : {}", bufferSizes);
return bufferSizes;
}
Aggregations