Add pool stats

This commit is contained in:
Brian J. Cardiff 2019-08-20 16:23:15 -03:00
parent dcd0af5ce8
commit 9275b22a30

View file

@ -28,6 +28,15 @@ module DB
@available.clear
end
record Stats, open_connections : Int32
# Returns stats of the pool
def stats
Stats.new(
open_connections: @total.size
)
end
def checkout : T
resource = if @available.empty?
if can_increase_pool