Class: RequestLog::Threads

Inherits:
Object
  • Object
show all
Includes:
Mongrel::HttpHandlerPlugin
Defined in:
lib/mongrel/debug.rb

Instance Method Summary collapse

Instance Method Details

#process(request, response) ⇒ Object



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/mongrel/debug.rb', line 175

def process(request, response)
  MongrelDbg::trace(:threads, "#{Time.now} REQUEST #{request.params['PATH_INFO']}")
  begin
    ObjectSpace.each_object do |obj|
      begin
        if obj.class == Mongrel::HttpServer
          worker_list = obj.workers.list
  
          if worker_list.length > 0
            keys = "-----\n\tKEYS:"
            worker_list.each {|t| keys << "\n\t\t-- #{t}: #{t.keys.inspect}" }
          end
  
          MongrelDbg::trace(:threads, "#{obj.host}:#{obj.port} -- THREADS: #{worker_list.length} #{keys}")
        end
      rescue Object # Ignore since obj.class can sometimes take parameters            
      end
    end
  rescue Object # Ignore since ObjectSpace might not be loaded on JRuby
  end
end