Forum: Ruby on Rails Display the time between a request and a response

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5bbaf82e891bb25702a10782b6b17f56?d=identicon&s=25 Pascal Friederich (Guest)
on 2007-05-10 13:08
(Received via mailing list)
Hi,

i want to display the time that rails needs to render / process a
request from the user. From start -> a request from a user is
recieved by my application -> the db requests and all the logics
are processed -> the view is rendered -> the response is beeing send -
> stop.

I dont want to do this with apache benchmark or s.th. like that. Just
with ruby / rails stuff. I dont want to add the Webserver overhead,
just the
time rails needs to process a request from recieve to response so i
can
show it in each view at the bottom of the page.

is there a rails / ruby way to do this?

Pascal
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-05-10 13:18
(Received via mailing list)
Pascal,

  > i want to display the time that rails needs to render / process a
  > request from the user. From start -> a request from a user is


Try the
   Timer plugin


I would use code like this in the page footer :
  <% if current_user_is_admin? -%>
    <script type="text/javascript" charset="utf-8">
       window.status = "  Action= <%= sprintf("%2.3f", runtime) %>
sec.,"
    </script>
  <% end %>


Another valuable plugin is the
   query_stats plugin
   http://agilewebdevelopment.com/plugins/query_stats
It tells you about the DB related activities. Very useful to find the
slow spots to cache.


Alain
---
blog.ravet.com
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-05-10 13:18
(Received via mailing list)
This topic is locked and can not be replied to.