tyrex.resource
public class PoolMetrics extends Object
This object records usage metrics for the connection pool, recording such information as the accumulated number of connections created and used, the average time a connection is used by the application or held in the pool, etc.
Version: $Revision: 1.5 $
Field Summary | |
---|---|
protected int | _available
The number of connections available in the pool (unused). |
protected int | _total
The total number of connections in the pool, both used and unused. |
Method Summary | |
---|---|
int | getAvailable()
Returns the number of connections available to the pool.
|
int | getCurrentUnused()
Returns the current number of managed connection not in use.
|
int | getCurrentUsed()
Returns the current number of managed connections in use.
|
int | getTotal()
Returns the total number of connections in the pool.
|
int | getTotalCreated()
Returns the number of managed connections created during the
lifetime of this connector. |
int | getTotalDiscarded()
Returns the number of managed connections discarded. |
int | getTotalErrors()
Returns the number of managed connections discarded due to an
error in the connection.
|
int | getTotalUsed()
Returns the number of client connections used. |
float | getUnusedAvgDuration()
Returns the average duration for holding a connection in the pool.
|
float | getUsedAvgDuration()
Return the average duration for using a connection. |
protected void | recordCreated()
Record a created managed connection. |
protected void | recordDiscard()
Record a discarded managed connection. |
protected void | recordError()
Record an error release of a managed connection. |
protected void | recordUnusedDuration(int ms)
Record the duration for holding a connection.
|
protected void | recordUsedDuration(int ms)
Record the duration for using a connection.
|
void | reset()
Called to reset this metrics object. |
Returns: The number of available connections
getCurrentUsed
it represents the total number of connections
currently managed by the pool.
Returns: The current number of unused managed connections
Returns: The current number of managed connections in use
Returns: The total number of connections in the pool
Returns: The number of managed connections created
Returns: The number of managed connections discarded
Returns: The number of erroneous connections
The ratio getAccumUsed
/ getAccumCreated
#getAccumCreated
represents how many client connections are
obtained from each managed connections.
Returns: The number of client connections used
Returns: The average duration for holding an unused connection
Returns: The average duration for using a connection
Parameters: ms The duration is milliseconds
Parameters: ms The duration is milliseconds