|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.resource.PoolMetrics
Holds metrics associated with a connection pool.
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.
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. |
Constructor Summary | |
PoolMetrics()
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int _total
protected int _available
Constructor Detail |
public PoolMetrics()
Method Detail |
public int getTotalCreated()
public int getTotalUsed()
The ratio getAccumUsed
/ #getAccumCreated
represents how many client connections are
obtained from each managed connections.
public int getTotalDiscarded()
public int getTotalErrors()
public int getCurrentUsed()
public int getCurrentUnused()
getCurrentUsed
it represents the total number of connections
currently managed by the pool.
public float getUsedAvgDuration()
public float getUnusedAvgDuration()
public int getTotal()
public int getAvailable()
public void reset()
protected void recordCreated()
protected void recordDiscard()
protected void recordError()
protected void recordUsedDuration(int ms)
ms
- The duration is millisecondsprotected void recordUnusedDuration(int ms)
ms
- The duration is milliseconds
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |