Ralph::Database::PoolStats
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
Instance methods
clone
Sourcecopy_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)
Sourceidle_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)