Top Description Methods
io.r2dbc.pool

public Interface PoolMetrics

Known Direct Implementers
io.r2dbc.pool.ConnectionPool.PoolMetricsWrapper
Imports
reactor.pool.Pool

An object that can be used to get live information about a ConnectionPool, suitable for gauge metrics.

getXxx methods are configuration accessors, their values that won't change over time, whereas other methods can be used as gauges to introspect the current state of the pool.

Author
Mark Paluch

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of acquired connections
acquiredSize
()

Measure the current number of connections that have been successfully ConnectionPool#create() acquired} and are in active use.

public int

Returns:

the total number of allocated connections managed by the Pool
allocatedSize
()

Measure the current number of allocated connections in the ConnectionPool, acquired or idle.

public int

Returns:

the maximum number of live connections that can be allocated by the ConnectionPool.
getMaxAllocatedSize
()

Get the maximum number of live connections this ConnectionPool will allow.

public int

Returns:

the maximum number of pending acquire that can be enqueued by the ConnectionPool.
getMaxPendingAcquireSize
()

Get the maximum number of ConnectionPool#create() this ConnectionPool can queue in a pending state when no available connection is immediately handy (and the ConnectionPool cannot allocate more connections).

public int

Returns:

the number of idle connections
idleSize
()

Measure the current number of idle connections in the ConnectionPool.

public int

Returns:

the number of pending acquire
pendingAcquireSize
()

Measure the current number of "pending" ConnectionPool#create() acquire Monos in the ConnectionPool.

Method Detail

acquiredSizeback to summary
public int acquiredSize()

Measure the current number of connections that have been successfully ConnectionPool#create() acquired} and are in active use.

Returns:int

the number of acquired connections

allocatedSizeback to summary
public int allocatedSize()

Measure the current number of allocated connections in the ConnectionPool, acquired or idle.

Returns:int

the total number of allocated connections managed by the Pool

getMaxAllocatedSizeback to summary
public int getMaxAllocatedSize()

Get the maximum number of live connections this ConnectionPool will allow.

A ConnectionPool might be unbounded, in which case this method returns Integer#MAX_VALUE.

Returns:int

the maximum number of live connections that can be allocated by the ConnectionPool.

getMaxPendingAcquireSizeback to summary
public int getMaxPendingAcquireSize()

Get the maximum number of ConnectionPool#create() this ConnectionPool can queue in a pending state when no available connection is immediately handy (and the ConnectionPool cannot allocate more connections).

A ConnectionPool pending queue might be unbounded, in which case this method returns Integer#MAX_VALUE.

Returns:int

the maximum number of pending acquire that can be enqueued by the ConnectionPool.

idleSizeback to summary
public int idleSize()

Measure the current number of idle connections in the ConnectionPool.

Note that some connections might be lazily evicted when they're next considered for an incoming ConnectionPool#create() call. Such connections would still count towards this method.

Returns:int

the number of idle connections

pendingAcquireSizeback to summary
public int pendingAcquireSize()

Measure the current number of "pending" ConnectionPool#create() acquire Monos in the ConnectionPool.

An acquire is in the pending state when it is attempted at a point when no idle connections is available in the pool, and no new connection can be created.

Returns:int

the number of pending acquire