Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 1113

Show
Ignore:
Timestamp:
04/07/05 16:27:24 (4 years ago)
Author:
bitsweat
Message:

Disable GC during request. Insert results before </html> to appease validating browsers.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/conductor/lib/request_profiler.rb

    r1052 r1113  
    4747    # Begin profiling.  Ignore if profiling has already begun. 
    4848    def before(controller) 
     49      GC.disable 
    4950      Prof.start rescue true 
    5051    end 
     
    5354    def after(controller) 
    5455      results = Prof.stop 
    55       controller.response.body << render_results(results) 
     56      GC.enable 
     57      GC.start 
     58      str = render_results(results) 
     59      controller.response.body.gsub!(%r(</html>\s*$)m, "#{str}</html>") 
    5660    end 
    5761 
     
    101105            r.self_time * 1000 / r.count, 
    102106            r.total_time * 1000 / r.count, 
    103             name 
     107            CGI.escapeHTML(name) 
    104108          ) 
    105109        end