Search in sources :

Example 6 with BitCountingHeaderEncoder

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

Example 7 with BitCountingHeaderEncoder

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());
}
Also used : JoinIntFieldStrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinIntFieldStrategyAnalyzer) JoinIntFieldStrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinIntFieldStrategyAnalyzer) StrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer) BitCountingHeaderEncoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder) StringEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StringEncodingStrategy) JoinDataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceBo) UnsignedShortEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedShortEncodingStrategy) AgentStatHeaderEncoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderEncoder)

Example 8 with BitCountingHeaderEncoder

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

Example 9 with BitCountingHeaderEncoder

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

Example 10 with BitCountingHeaderEncoder

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());
}
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