You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/09/03 13:15:00 UTC

[jira] [Commented] (HTTPCLIENT-2233) Metrics missing

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17599920#comment-17599920 ] 

Gary D. Gregory commented on HTTPCLIENT-2233:
---------------------------------------------

[~patrickjamesbarry] 

You could open a PR on GitHub with a proposal to open up the API to better serve your use case.

> Metrics missing
> ---------------
>
>                 Key: HTTPCLIENT-2233
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2233
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (async)
>    Affects Versions: 5.1.3
>            Reporter: Patrick Barry
>            Priority: Major
>
> We wish to capture metrics on ioReactor threadpool.  But it is so locked down, we cannot provide our own executor, nor capture metrics around a provided one.  We are entertaining manually capturing some metrics from a customized ThreadPool, but that definitely not ideal.
> *Details:*
> In HttpAsyncClientBuilder.java, the builder does not expose the ability to provide your own implementation of AbstractIOReactorBase.  Therefore, you are stuff using the default, that you do not have any access to.
> *Goal:* We need client metrics.  We need a way to capture runtime metrics which would alert us when we start to experience back pressure, resource starvation, etc.
>  
> {code:java}
> final DefaultConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(
>         ioEventHandlerFactory,
>         ioReactorConfig != null ? ioReactorConfig : IOReactorConfig.DEFAULT,
>         threadFactory != null ? threadFactory : new DefaultThreadFactory("httpclient-dispatch", true),
>         LoggingIOSessionDecorator.INSTANCE,
>         ioReactorExceptionCallback != null ? ioReactorExceptionCallback : LoggingExceptionCallback.INSTANCE,
>         null,
>         new Callback<IOSession>() {
>             @Override
>             public void execute(final IOSession ioSession) {
>                 ioSession.enqueue(new ShutdownCommand(CloseMode.GRACEFUL), Command.Priority.IMMEDIATE);
>             }
>         });
>  {code}
> -The only thing we have see around metrics for this library is FutureRequestExecutionService. However, haven't seen anyone use it with HttpAsyncClient.  It looks like if we were to try to use it, we would have 2 executors in play. The ioReactor threadpool doing the work, the another one (FutureRequestExecutionService executor)  that would wrap the work being done on the ioReactor. Because of that, it doesn't feel like that is the route we should go, but definitely need advise in this area.-  
> FutureRequestExecutionService is not an option because it only support HttpClient, not AsyncHttpClient
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org