mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Add pool stats
This commit is contained in:
parent
dcd0af5ce8
commit
9275b22a30
1 changed files with 9 additions and 0 deletions
|
@ -28,6 +28,15 @@ module DB
|
||||||
@available.clear
|
@available.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
|
record Stats, open_connections : Int32
|
||||||
|
|
||||||
|
# Returns stats of the pool
|
||||||
|
def stats
|
||||||
|
Stats.new(
|
||||||
|
open_connections: @total.size
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def checkout : T
|
def checkout : T
|
||||||
resource = if @available.empty?
|
resource = if @available.empty?
|
||||||
if can_increase_pool
|
if can_increase_pool
|
||||||
|
|
Loading…
Reference in a new issue