Made statistics collection optional in BaseGenericObjectPool#429
Made statistics collection optional in BaseGenericObjectPool#429garydgregory merged 9 commits intoapache:masterfrom
Conversation
|
Hi @psteitz |
|
Hello @Pratyay |
|
Hello @garydgregory, thanks for the revert
|
Removed unnecessary blank lines in test method.
|
@Pratyay If you'd like to see this feature in the 2.x release, line please create a PR against the branch named |
|
Thanks @garydgregory. |
Sorry to be late to the party. Looks like a reasonable request and impl looks good. Many thanks for the additional tests. I am tempted to try to improve the stats store concurrency tests to do more validation of values, but that will be a little tricky. I guess its OK that JMX will return 0's for the un-tracked stats when turned off. +1 to merge into 2_X as well. |


Problem Statement
While analyzing pool performance under high load, I identified that detailed statistics collection (mean active time, mean idle time, mean borrow wait time) can become a bottleneck in high-throughput scenarios. These statistics, while valuable for monitoring, involve timing calculations and circular buffer operations that add overhead to every borrow/return operation. For applications that prioritize throughput over detailed monitoring, there is no way to disable this overhead, and it leads to useful threads blocked on the synchronized block.
Proposed Solution
Implement a new configuration option collectDetailedStatistics that allows users to disable detailed timing statistics collection.