The rails scirpt script/performance/request
require a session script, what is the best way to generate this session script?
Add this code to your application.rb file
before_filter :benchmark_log
def benchmark_log
File.open("request_log.txt","a") do |f|
f.puts request.method.to_s + " '" + request.request_uri + "', " + params.except(:action).except(:controller).inspect.gsub(/(^\{|\}$)/,"")
end
end
Then you can visit several pages in your browser, and the session script will be written into the request_log.txt file in your applications root directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With