-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPCLIENT-2233- Add Metrics Collection for IOReactor Thread Pool #490
Conversation
|
dabbcf7
to
a5b7bf0
Compare
@ok2c |
@arturobernalg All right. Please do add missing |
@@ -315,6 +326,18 @@ private void validateAddress(final SocketAddress address) throws UnknownHostExce | |||
private void processPendingConnectionRequests() { | |||
IOSessionRequest sessionRequest; | |||
for (int i = 0; i < MAX_CHANNEL_REQUESTS && (sessionRequest = this.requestQueue.poll()) != null; i++) { | |||
|
|||
// Calculate wait time safely without keeping long-lived state | |||
final long waitTimeMillis = System.currentTimeMillis() - sessionRequest.getEnqueueTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arturobernalg Would you agree to move metrics collection inside if (threadPoolListener != null) {
? There is no need to collect them if there is no listener.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ok2c done
…oring This change enhances monitoring capabilities for the IOReactor thread pool, providing better insights into performance and potential bottlenecks.
c02051b
to
d40a582
Compare
…oring (#490) This change enhances monitoring capabilities for the IOReactor thread pool, providing better insights into performance and potential bottlenecks.
@arturobernalg I added missing |
This PR addresses HTTPCLIENT-2233 by implementing a mechanism for collecting metrics on the IOReactor thread pool in Apache HttpClient. The changes introduce an IOReactorMetricsListener interface and a LoggingIOReactorMetricsListener implementation to monitor and report key metrics for better insight into reactor performance and load.