InstrumentedPool is a Pool that exposes a few additional methods
around metrics.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | InstrumentedPool.PoolMetrics
An object that can be used to get live information about a |
| Modifier and Type | Method and Description |
|---|---|
| public InstrumentedPool. |
| metrics | back to summary |
|---|---|
public InstrumentedPool.
| |
Pool, suitable
for gauge metrics.
getXxx methods are configuration accessors, ie values that won't change over time, whereas other methods can be used as gauges to introspect the current state of the pool.
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the number of acquired resourcesMeasure the current number of resources that have been successfully
|
| public int | Returns: the total number of allocated resources managed by thePoolMeasure the current number of allocated resources in the |
| public int | Returns: the maximum number of live resources that can be allocated by thisPoolGet the maximum number of live resources this |
| public int | Returns: the maximum number of pending acquire that can be enqueued by thisPoolGet the maximum number of |
| public int | |
| public default boolean | Returns: true if the pool can be considered inactive (see above), false otherwiseA convenience way to check the pool is inactive, in the sense that |
| public int | Returns: the number of pending acquireMeasure the current number of "pending" |
| public default long | Returns: a number of seconds indicative of the time elapsed since last pool interactionMeasure the duration in seconds since the pool was last interacted with in a meaningful way. |
| acquiredSize | back to summary |
|---|---|
| public int acquiredSize() Measure the current number of resources that have been successfully
| |
| allocatedSize | back to summary |
|---|---|
| public int allocatedSize() Measure the current number of allocated resources in the
| |
| getMaxAllocatedSize | back to summary |
|---|---|
| public int getMaxAllocatedSize() Get the maximum number of live resources this
A
| |
| getMaxPendingAcquireSize | back to summary |
|---|---|
| public int getMaxPendingAcquireSize() Get the maximum number of
A
| |
| idleSize | back to summary |
|---|---|
| public int idleSize() Measure the current number of idle resources in the
Note that some resources might be lazily evicted when they're next considered
for an incoming
| |
| isInactiveForMoreThan | back to summary |
|---|---|
| public default boolean isInactiveForMoreThan(Duration duration) A convenience way to check the pool is inactive, in the sense that
| |
| pendingAcquireSize | back to summary |
|---|---|
| public int pendingAcquireSize() Measure the current number of "pending" An acquire is in the pending state when it is attempted at a point when no idle resource is available in the pool, and no new resource can be created.
| |
| secondsSinceLastInteraction | back to summary |
|---|---|
| public default long secondsSinceLastInteraction() Measure the duration in seconds since the pool was last interacted with in a meaningful way.
This is a best effort indicator of pool inactivity, provided the pool counters
( The lower the duration, the greater the chances that an interaction could be occurring in parallel to this call. This is why the duration is truncated to the second. A pool implementation that cannot yet support this measurement MAY choose to return -1 seconds instead. Interactions include background eviction, disposal of the pool, explicit pool warmup, resource acquisition and release (in the default implementation, any interaction triggering the drain loop)...
| |