public interface PooledRefMetadata
PooledRef, which includes monotonic metrics like its age
(lifeTime()), number of times it was reused (acquireCount()), as well
as contextually changing metrics like the duration for which it has been idle in a pool
(idleTime()).| Modifier and Type | Method and Description |
|---|---|
int |
acquireCount()
Return the number of times the underlying pooled object has been used by consumers of the
Pool, via
either of Pool.acquire() or Pool.withPoolable(Function). |
long |
idleTime()
Returns the wall-clock number of milliseconds since the reference was last released (or allocated, if it was
never released).
|
long |
lifeTime()
Returns the age of the
PooledRef: the wall-clock time (in milliseconds) since which the underlying object
has been allocated. |
int acquireCount()
Pool, via
either of Pool.acquire() or Pool.withPoolable(Function). The first time an object is allocated, this
method returns 1, so the number of times it has been "recycled" can be deduced as acquireCount() - 1.long idleTime()
PooledRef that is currently acquired is required to return 0L.long lifeTime()
PooledRef: the wall-clock time (in milliseconds) since which the underlying object
has been allocated.