Search in sources :

Example 1 with EncodingStrategy

use of com.navercorp.pinpoint.common.server.bo.codec.strategy.EncodingStrategy 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<>();
    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;
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) HashMap(java.util.HashMap) EncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.strategy.EncodingStrategy) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Aggregations

AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)1 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)1 EncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.strategy.EncodingStrategy)1 HashMap (java.util.HashMap)1