services-gateway-benchmarks/src/main/java/io/scalecube/services/benchmarks/gateway/codec/GatewayMessageDecoderBenchmark.java
/**
   * Main runner.
   *
   * @param args program arguments
   */
Main runner.
@param args program arguments
Main runner . @param args program arguments
public static void main(String[] args) {
    BenchmarkSettings settings =
        BenchmarkSettings.from(args).durationUnit(TimeUnit.NANOSECONDS).build();
    new GatewayMessageCodecBenchmarkState(settings)
        .runForSync(
            state -> {
              GatewayMessageCodec codec = state.codec();
              BenchmarkTimer timer = state.timer("timer");
              BenchmarkMeter meter = state.meter("meter");
              return i -> {
                Context timerContext = timer.time();
                GatewayMessage message = codec.decode(state.byteBufExample().retain());
                Optional.ofNullable(message.data()).ifPresent(ReferenceCountUtil::safestRelease);
                timerContext.stop();
                meter.mark();
                return message;
              };
            });
  }
public static void main ( String [ ] args ) { BenchmarkSettings settings = BenchmarkSettings . from ( args ) . durationUnit ( TimeUnit . NANOSECONDS ) . build ( ) ; new GatewayMessageCodecBenchmarkState ( settings ) . runForSync ( state -> { GatewayMessageCodec codec = state . codec ( ) ; BenchmarkTimer timer = state . timer ( "timer" ) ; BenchmarkMeter meter = state . meter ( "meter" ) ; return i -> { Context timerContext = timer . time ( ) ; GatewayMessage message = codec . decode ( state . byteBufExample ( ) . retain ( ) ) ; Optional . ofNullable ( message . data ( ) ) . ifPresent ( ReferenceCountUtil :: safestRelease ) ; timerContext . stop ( ) ; meter . mark ( ) ; return message ; } ; } ) ; }
Main runner.
Main runner .