@@ -14,23 +14,23 @@ defmodule SQL.Pool do
1414 { :ok , initialize ( state ) }
1515 end
1616
17- def checkout ( % { id: id } = sql , pool \\ :default ) do
18- start_time = System . monotonic_time ( )
17+ def checkout ( % { id: _id } = sql , pool \\ :default ) do
18+ # start_time = System.monotonic_time()
1919 scheduler_id = :erlang . system_info ( :scheduler_id )
2020 state = :persistent_term . get ( { __MODULE__ , pool } )
2121 { _size , connections , activations , recent_activations , sockets , schedulers , _indexes , _health } = state
2222 { n , workers } = Map . get ( schedulers , scheduler_id )
2323 case checkout ( state , n , workers ) do
2424 :none = error ->
25- :telemetry . execute ( [ :sql , :checkout ] , % { pool: pool , duration: System . monotonic_time ( ) - start_time } , % { id: id } )
25+ # :telemetry.execute([:sql, :checkout], %{pool: pool, duration: System.monotonic_time()-start_time}, %{id: id})
2626 error
2727 { idx , _load } ->
2828 case :atomics . compare_exchange ( connections , idx , 0 , 1 ) do
2929 :ok ->
3030 :counters . add ( activations , idx , 1 )
3131 :counters . add ( recent_activations , idx , 1 )
3232 result = { idx , elem ( sockets , idx - 1 ) }
33- :telemetry . execute ( [ :sql , :checkout ] , % { pool: pool , duration: System . monotonic_time ( ) - start_time } , % { id: id } )
33+ # :telemetry.execute([:sql, :checkout], %{pool: pool, duration: System.monotonic_time()-start_time}, %{id: id})
3434 result
3535 _ ->
3636 checkout ( sql , pool )
0 commit comments