Search in sources :

Example 21 with BitCountingHeaderEncoder

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());
}
Also used : AgentStatHeaderEncoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderEncoder) BitCountingHeaderEncoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder)

Aggregations

AgentStatHeaderEncoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderEncoder)21 BitCountingHeaderEncoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder)21 JoinIntFieldStrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinIntFieldStrategyAnalyzer)1 StrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer)1 StringEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StringEncodingStrategy)1 UnsignedShortEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedShortEncodingStrategy)1 JoinDataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceBo)1