struct

Ralph::Database::PoolStats

Inherits Struct / Value / Object

Connection pool statistics

Provides insight into the current state of the connection pool. Useful for monitoring, debugging, and capacity planning.

Example

stats = Ralph.pool_stats
if stats
  puts "Open: #{stats.open_connections}"
  puts "Idle: #{stats.idle_connections}"
  puts "In-flight: #{stats.in_flight_connections}"
end

Constructors

new(open_connections : Int32, idle_connections : Int32, in_flight_connections : Int32, max_connections : Int32)
Source

Instance methods

clone
Source
copy_with(open_connections _open_connections = @open_connections, idle_connections _idle_connections = @idle_connections, in_flight_connections _in_flight_connections = @in_flight_connections, max_connections _max_connections = @max_connections)
Source
idle_connections

Number of connections currently idle in the pool

in_flight_connections

Number of connections currently checked out and in use

max_connections

Maximum connections allowed (0 = unlimited)

open_connections

Total number of open connections (idle + in-flight)