use of io.vertx.core.spi.metrics.ClientMetrics in project vert.x by eclipse.
the class HttpClientImpl method httpConnectionManager.
private ConnectionManager<EndpointKey, Lease<HttpClientConnection>> httpConnectionManager() {
int maxPoolSize = Math.max(options.getMaxPoolSize(), options.getHttp2MaxPoolSize());
return new ConnectionManager<>((key, ctx, dispose) -> {
ClientMetrics metrics = this.metrics != null ? this.metrics.createEndpointMetrics(key.serverAddr, maxPoolSize) : null;
HttpChannelConnector connector = new HttpChannelConnector(this, netClient, key.proxyOptions, metrics, options.getProtocolVersion(), key.ssl, options.isUseAlpn(), key.peerAddr, key.serverAddr);
return new SharedClientHttpStreamEndpoint(this, metrics, options.getMaxWaitQueueSize(), options.getMaxPoolSize(), options.getHttp2MaxPoolSize(), connector, dispose);
});
}
use of io.vertx.core.spi.metrics.ClientMetrics in project vert.x by eclipse.
the class HttpClientImpl method webSocketConnectionManager.
private ConnectionManager<EndpointKey, HttpClientConnection> webSocketConnectionManager() {
int maxPoolSize = options.getMaxWebSockets();
return new ConnectionManager<>((key, ctx, dispose) -> {
ClientMetrics metrics = this.metrics != null ? this.metrics.createEndpointMetrics(key.serverAddr, maxPoolSize) : null;
HttpChannelConnector connector = new HttpChannelConnector(this, netClient, key.proxyOptions, metrics, HttpVersion.HTTP_1_1, key.ssl, false, key.peerAddr, key.serverAddr);
return new WebSocketEndpoint(null, maxPoolSize, connector, dispose);
});
}
Aggregations