use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder in project pinpoint by naver.
the class TransactionCodecV2 method encodeDataPoints.
private void encodeDataPoints(Buffer valueBuffer, StrategyAnalyzer<Long> collectIntervalStrategyAnalyzer, StrategyAnalyzer<Long> sampledNewCountStrategyAnalyzer, StrategyAnalyzer<Long> sampledContinuationCountStrategyAnalyzer, StrategyAnalyzer<Long> unsampledNewCountStrategyAnalyzer, StrategyAnalyzer<Long> unsampledContinuationCountStrategyAnalyzer) {
// encode header
AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();
headerEncoder.addCode(collectIntervalStrategyAnalyzer.getBestStrategy().getCode());
headerEncoder.addCode(sampledNewCountStrategyAnalyzer.getBestStrategy().getCode());
headerEncoder.addCode(sampledContinuationCountStrategyAnalyzer.getBestStrategy().getCode());
headerEncoder.addCode(unsampledNewCountStrategyAnalyzer.getBestStrategy().getCode());
headerEncoder.addCode(unsampledContinuationCountStrategyAnalyzer.getBestStrategy().getCode());
final byte[] header = headerEncoder.getHeader();
valueBuffer.putPrefixedBytes(header);
// encode values
this.codec.encodeValues(valueBuffer, collectIntervalStrategyAnalyzer.getBestStrategy(), collectIntervalStrategyAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, sampledNewCountStrategyAnalyzer.getBestStrategy(), sampledNewCountStrategyAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, sampledContinuationCountStrategyAnalyzer.getBestStrategy(), sampledContinuationCountStrategyAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, unsampledNewCountStrategyAnalyzer.getBestStrategy(), unsampledNewCountStrategyAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, unsampledContinuationCountStrategyAnalyzer.getBestStrategy(), unsampledContinuationCountStrategyAnalyzer.getValues());
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder in project pinpoint by naver.
the class DataSourceCodec method encodeJoinDataSourceBo.
private void encodeJoinDataSourceBo(Buffer valueBuffer, List<JoinDataSourceBo> joinDataSourceBoList) {
final int numValues = joinDataSourceBoList.size();
valueBuffer.putVInt(numValues);
UnsignedShortEncodingStrategy.Analyzer.Builder serviceTypeAnalyzerBuilder = new UnsignedShortEncodingStrategy.Analyzer.Builder();
StringEncodingStrategy.Analyzer.Builder jdbcUrlAnalyzerBuilder = new StringEncodingStrategy.Analyzer.Builder();
JoinIntFieldStrategyAnalyzer.Builder activeConnectionSizeAnalyzerBuilder = new JoinIntFieldStrategyAnalyzer.Builder();
for (JoinDataSourceBo joinDataSourceBo : joinDataSourceBoList) {
serviceTypeAnalyzerBuilder.addValue(joinDataSourceBo.getServiceTypeCode());
jdbcUrlAnalyzerBuilder.addValue(joinDataSourceBo.getUrl());
activeConnectionSizeAnalyzerBuilder.addValue(joinDataSourceBo.getActiveConnectionSizeJoinValue());
}
StrategyAnalyzer<Short> serviceTypeAnalyzer = serviceTypeAnalyzerBuilder.build();
StrategyAnalyzer<String> jdbcUrlAnalyzer = jdbcUrlAnalyzerBuilder.build();
JoinIntFieldStrategyAnalyzer activeConnectionSizeAnalyzer = activeConnectionSizeAnalyzerBuilder.build();
AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();
headerEncoder.addCode(serviceTypeAnalyzer.getBestStrategy().getCode());
headerEncoder.addCode(jdbcUrlAnalyzer.getBestStrategy().getCode());
final byte[] codes = activeConnectionSizeAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
final byte[] header = headerEncoder.getHeader();
valueBuffer.putPrefixedBytes(header);
this.codec.encodeValues(valueBuffer, serviceTypeAnalyzer.getBestStrategy(), serviceTypeAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, jdbcUrlAnalyzer.getBestStrategy(), jdbcUrlAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, activeConnectionSizeAnalyzer.getBestStrategy(), activeConnectionSizeAnalyzer.getValues());
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder in project pinpoint by naver.
the class MemoryCodec method encodeDataPoints.
private void encodeDataPoints(Buffer valueBuffer, JoinLongFieldStrategyAnalyzer heapUsedStrategyAnalyzer, JoinLongFieldStrategyAnalyzer nonHeapUsedStrategyAnalyzer) {
// encode header
AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();
byte[] codes = heapUsedStrategyAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
codes = nonHeapUsedStrategyAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
final byte[] header = headerEncoder.getHeader();
valueBuffer.putPrefixedBytes(header);
// encode values
this.codec.encodeValues(valueBuffer, heapUsedStrategyAnalyzer.getBestStrategy(), heapUsedStrategyAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, nonHeapUsedStrategyAnalyzer.getBestStrategy(), nonHeapUsedStrategyAnalyzer.getValues());
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder in project pinpoint by naver.
the class TotalThreadCountCodec method encodeDataPoints.
private void encodeDataPoints(Buffer valueBuffer, JoinLongFieldStrategyAnalyzer totalThreadCountAnalyzer) {
AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();
final byte[] codes = totalThreadCountAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
final byte[] header = headerEncoder.getHeader();
valueBuffer.putPrefixedBytes(header);
this.codec.encodeValues(valueBuffer, totalThreadCountAnalyzer.getBestStrategy(), totalThreadCountAnalyzer.getValues());
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder in project pinpoint by naver.
the class DirectBufferCodec method encodeDataPoints.
private void encodeDataPoints(Buffer valueBuffer, JoinLongFieldStrategyAnalyzer directCountAnalyzer, JoinLongFieldStrategyAnalyzer directMemoryUsedAnalyzer, JoinLongFieldStrategyAnalyzer mappedCountAnalyzer, JoinLongFieldStrategyAnalyzer mappedMemoryUsedAnalyzer) {
// encode header
AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();
byte[] codes = directCountAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
codes = directMemoryUsedAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
codes = mappedCountAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
codes = mappedMemoryUsedAnalyzer.getBestStrategy().getCodes();
for (byte code : codes) {
headerEncoder.addCode(code);
}
final byte[] header = headerEncoder.getHeader();
valueBuffer.putPrefixedBytes(header);
// encode values
this.codec.encodeValues(valueBuffer, directCountAnalyzer.getBestStrategy(), directCountAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, directMemoryUsedAnalyzer.getBestStrategy(), directMemoryUsedAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, mappedCountAnalyzer.getBestStrategy(), mappedCountAnalyzer.getValues());
this.codec.encodeValues(valueBuffer, mappedMemoryUsedAnalyzer.getBestStrategy(), mappedMemoryUsedAnalyzer.getValues());
}
Aggregations