commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Caswell" <>
Subject [pool] PROPOSAL: add collecting of statistics to pool implementations
Date Tue, 23 Apr 2002 21:24:39 GMT
Proposal: add collecting of statistics to pool implementations

Reasoning: I'd like to be able to get stats from a pooling
implementation to see how well the various configuration parameters are
set. For example, in the GenericObjectPool implementation, I'd like to
know how many waits occurred, how many times the pool was extended, etc.

Proposed design changes:
- Create an interface called PoolStatistics that defines operations for
obtaining the statistics values and associated labels.  Actual values
would be returned in an array of ints. Value labels would be returned in
an array of Strings. This would allow each pool implementation class to
define its own set of statistics and label them accordingly.
- Create an interface called Measurable that would be implemented by a
pool that supports reporting of statistics. This interface defines the
operation that returns an instance of PoolStatistics. Defining a
separate interface allows individual pool implementations to support or
not support reporting statistics at the choosing of the implementor.

I've attached source code for the new PoolStatistics and Measurable
interfaces.  I've also attached patches to the GenericObjectPool and
GenericObjectPoolFactory implementation classes that provide a first cut
implementation, and the TestGenericObjectPool test case. I've run the
test cases on these changes and they pass. If this proposal is accepted
in some form I'll be happy to add a first cut implementation to the
other pool implementation classes.

Steven Caswell

View raw message