[jira] Created: (POOL-159) GenericObjectPool: Add a getNumWaiters() method for monitoring purposes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (POOL-159) GenericObjectPool: Add a getNumWaiters() method for monitoring purposes

JIRA jira@apache.org
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.4
            Reporter: Mike Muller


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.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (POOL-159) GenericObjectPool: Add a getNumWaiters() method for monitoring purposes

JIRA jira@apache.org

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

Phil Steitz updated POOL-159:
-----------------------------

        Fix Version/s: 1.5.5
    Affects Version/s: 1.5.3
                       1.5.2
                       1.5.1
                       1.5

> 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
>             Fix For: 1.5.5
>
>
> 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 contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (POOL-159) GenericObjectPool: Add a getNumWaiters() method for monitoring purposes

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Phil Steitz updated POOL-159:
-----------------------------

    Fix Version/s: 2.0
                       (was: 1.5.5)

I think this is a reasonable feature request and the suggested implementation will be fairly accurate.  I would prefer to hold off adding this until 2.0 though, as it is an API contract extension and we may want to specify the contract differently if the underlying pool implementation changes (which is likely).

> 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
>             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.
-
You can reply to this email to add a comment to the issue online.