File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,22 @@ def process(req)
128128 doauth = false
129129 mname << '_noauth'
130130 end
131-
131+ stats = ActiveRecord ::Base . connection_pool . stat
132+ if File . exist? ( '../scenario_name2.txt' )
133+ name = File . binread ( '../scenario_name2.txt' ) . strip
134+ else
135+ name = 'EMPTY FILE'
136+ end
137+ pool = ActiveRecord ::Base . connection_pool
138+ pool . connections . each do |connection |
139+ Rails . logger . info (
140+ connection . owner . present? ? connection . owner . inspect : "[UNUSED]"
141+ )
142+ $stderr. puts ( connection . owner . present? ? connection . owner . inspect : "[UNUSED]" )
143+ end
144+ $stderr. puts ( "#{ Time . now } - Scenario #{ name } Connection Pool Stats Engine RPC: #{ mname } #{ stats . inspect } " )
145+ Rails . logger . info ( "#{ Time . now } - Scenario #{ name } Connection Pool Stats Engine RPC: #{ mname } #{ stats . inspect } " )
146+ File . write ( "../engine_stats.txt" , "Connection Pool Stats Engine RPC: #{ mname } #{ stats . inspect } \n " , mode : "wb" )
132147 unless self . handlers [ group ] . respond_to? ( mname )
133148 raise ArgumentError , "Unknown API Call: '#{ mname . inspect } '"
134149 end
You can’t perform that action at this time.
0 commit comments