jira-importer opened a new issue, #963: URL: https://github.com/apache/httpcomponents-core/issues/963
**[Seth Weiner](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=sethweiner)** opened **[HTTPCORE-311](https://issues.apache.org/jira/browse/HTTPCORE-311?redirect=false)** and commented The org.apache.http.pool.ConnPoolControl interface exposes valuable runtime metrics for a connection pool's individual routes and global values. However, it uses a bean class, org.apache.http.pool.PoolStats, to exposes the global values. This is problematic when trying to monitor these connection pool values at runtime since PoolStats is not Serializable and many jmx monitoring agents only support primitive values well. The value of the PoolStats class seems to be in trying to minimize the amount of locking of the pool required to get stats. The attached patch includes an interface that extends ConnPoolControl to add four methods to return the primitive value for global pool stats. There's an implementation of this interface that will delegate all of the ConnPoolControl methods to a delegate instance, and support retrieving the primitive global values by periodically retrieving and caching a PoolStats instance internally. This minimizes the amount of locking required while also making it easy to monitor these values. It would probably be ideal to incorporate this functionality directly into the existing ConnPoolControl interface, but the attached code provides a non-invasive way to achieve the desired effect. --- **Affects:** 4.2.1 **Attachments:** - [httpcomponents-monitoring-patch.diff](https://issues.apache.org/jira/secure/attachment/12545748/httpcomponents-monitoring-patch.diff) (_8.22 kB_) - [httpcomponents-monitoring-patch2.diff](https://issues.apache.org/jira/secure/attachment/12545774/httpcomponents-monitoring-patch2.diff) (_13.61 kB_) - [httpcomponents-monitoring-patch3.diff](https://issues.apache.org/jira/secure/attachment/12545780/httpcomponents-monitoring-patch3.diff) (_6.30 kB_) - [PollingPrimitivePoolControl.java](https://issues.apache.org/jira/secure/attachment/12545211/PollingPrimitivePoolControl.java) (_2.22 kB_) - [PollingPrimitivePoolControlTest.java](https://issues.apache.org/jira/secure/attachment/12545210/PollingPrimitivePoolControlTest.java) (_4.85 kB_) - [PrimitiveConnPoolControl.java](https://issues.apache.org/jira/secure/attachment/12545212/PrimitiveConnPoolControl.java) (_221 bytes_) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
