commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (POOL-159) GenericObjectPool: Add a getNumWaiters() method for monitoring purposes
Date Wed, 14 Dec 2011 22:49:30 GMT

     [ https://issues.apache.org/jira/browse/POOL-159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Thomas resolved POOL-159.
------------------------------

    Resolution: Fixed

With the POOL2 re-write, this was easy to implement.
                
> GenericObjectPool: Add a getNumWaiters() method for monitoring purposes
> -----------------------------------------------------------------------
>
>                 Key: POOL-159
>                 URL: https://issues.apache.org/jira/browse/POOL-159
>             Project: Commons Pool
>          Issue Type: Improvement
>    Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4
>            Reporter: Mike Muller
>              Labels: monitoring
>             Fix For: 2.0
>
>
> I would like to be able to determine the number of threads waiting to obtain an object
from the pool for monitoring purposes.  This would be most applicable when the WHEN_EXHAUSTED_BLOCK
option is used.  I propose the following method:
>     /**
>      * Return the number of threads currently waiting for an object from this pool.
>      *
>      * @return the number of threads currently waiting for an object from this pool
>      */
>     public synchronized int getNumWaiters() {
>         return _allocateQueue.size();
>     }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message