Adrian
Adrian

Reputation: 1025

How to check number of http connections used at a specific point in time?

I have project with vertx where I am using a HtttpClient where I configurure a HttpConfigOption object in order to specify host, maxPoolSize, keepAlive, etc.

  HttpClientOptions httpClientOptions = new HttpClientOptions()
                        .setKeepAlive(KeepAlive)
                        .setDefaultHost(baseUrl)
                        .setTcpNoDelay(true)
                        .setVerifyHost(verifyHost)
                        .setTrustAll(trustAll)
                        .setMaxPoolSize(50)
                        .setPoolCleanerPeriod(POOL_CLEANER_PERIOD)
                        .setDefaultPort(port).setSsl(isSSl);

I start having some timeouts and I want to know if the problem is from my connection pool or the timeouts are coming from the services that I consume.

Is there a way to print in vertx the number of connections that are at the moment in use? So for example let's say that I have a poll with max 50 connections and on timeout it will be nice if I can print the number of connections that are active, in use.

Thanks

Upvotes: 0

Views: 673

Answers (1)

Asad Awadia
Asad Awadia

Reputation: 1521

You can use the vertx micrometer module to grab vertx_http_client_active_connections

ref: https://vertx.io/docs/vertx-micrometer-metrics/java/

Upvotes: 0

Related Questions