use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder in project pinpoint by naver.
the class DataSourceCodecV2 method encodeDataPoints.
private void encodeDataPoints(Buffer valueBuffer, StrategyAnalyzer<Integer> idAnalyzerBuilder, StrategyAnalyzer<Short> serviceTypeAnalyzerBuilder, StrategyAnalyzer<String> databaseNameAnalyzerBuilder, StrategyAnalyzer<String> jdbcUrlAnalyzerBuilder, StrategyAnalyzer<Integer> activeConnectionSizeAnalyzerBuilder, StrategyAnalyzer<Integer> maxConnectionSizeAnalyzerBuilder) {
// encode header
AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();
headerEncoder.addCode(idAnalyzerBuilder.getBestStrategy().getCode());
headerEncoder.addCode(serviceTypeAnalyzerBuilder.getBestStrategy().getCode());
headerEncoder.addCode(databaseNameAnalyzerBuilder.getBestStrategy().getCode());
headerEncoder.addCode(jdbcUrlAnalyzerBuilder.getBestStrategy().getCode());
headerEncoder.addCode(activeConnectionSizeAnalyzerBuilder.getBestStrategy().getCode());
headerEncoder.addCode(maxConnectionSizeAnalyzerBuilder.getBestStrategy().getCode());
final byte[] header = headerEncoder.getHeader();
valueBuffer.putPrefixedBytes(header);
// encode values
this.codec.encodeValues(valueBuffer, idAnalyzerBuilder.getBestStrategy(), idAnalyzerBuilder.getValues());
this.codec.encodeValues(valueBuffer, serviceTypeAnalyzerBuilder.getBestStrategy(), serviceTypeAnalyzerBuilder.getValues());
this.codec.encodeValues(valueBuffer, databaseNameAnalyzerBuilder.getBestStrategy(), databaseNameAnalyzerBuilder.getValues());
this.codec.encodeValues(valueBuffer, jdbcUrlAnalyzerBuilder.getBestStrategy(), jdbcUrlAnalyzerBuilder.getValues());
this.codec.encodeValues(valueBuffer, activeConnectionSizeAnalyzerBuilder.getBestStrategy(), activeConnectionSizeAnalyzerBuilder.getValues());
this.codec.encodeValues(valueBuffer, maxConnectionSizeAnalyzerBuilder.getBestStrategy(), maxConnectionSizeAnalyzerBuilder.getValues());
}
Aggregations