Displaying page response time and AJAX request response times with Rack middleware
I want to write a piece of Ra开发者_开发问答ck middleware that will display the response time for rendering the page, as well as the response times for any AJAX requests made on the page. What's the best way to go about doing this?
You can try something based on this railscast. It injects response times as HTML comments into your page source. For AJAX requests, you can inspect the content-type/x-requested-with headers to inject the timing information in the appropriate format.
精彩评论