0

We have Netty based HTTP server (build on Spring WebFlux) and need to implement a kind of client request statistics (request processing time per type, request queuing time, etc). Could you please advice what is the right way to calculate request queuing time in Netty, i.e. the time between the moment request is accepted by the input socket and passed to the corresponding handler.

1 Answers1

0

You should create a WebClient from configured WebClient.Builder that has predefined metrics. For example:

@Configuration
public class WebClientConfiguration {
 
  @Bean
  public WebClient webClient(WebClient.Builder webClientBuilder) {
    return webClientBuilder
      .build();
  }
}
Timur
  • 51
  • 6
  • We have the server only, that is supposed to be reached by any kind of client - so the purpose is to collect such metrics inside the server. – Vadim Lotarev Jun 06 '21 at 08:06
  • What kind of metrics do you need? Did you check https://projectreactor.io/docs/netty/release/reference/index.html#_metrics_4? – Violeta Georgieva Jun 08 '21 at 07:27
  • Yes, I saw that documentation and did not find the metrics that we need - the time request is queued until been processed. – Vadim Lotarev Jun 21 '21 at 12:10