# Time taken by page to load

**URL:** <https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234>\
**Category:** Rails\
**Created:** [January 25, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234 "2010-01-25T15:31:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 25, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/1 "2010-01-25T15:31:22Z")

</div>

Champs,

Is there any way to find out that how much time a page had taken to load  
itself ? Googled for it but no luck… :’(

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 25, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/2 "2010-01-25T15:41:12Z")

</div>

You can check your rails logs. There you will find out how long time  
your request took in db, rendering views and the total time.

/K

2010/1/25 Hemant B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 25, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/3 "2010-01-25T15:41:12Z")

</div>

On 25 Jan 2010, at 15:31, Hemant B. wrote:

> Is there any way to find out that how much time a page had taken to  
> load  
> itself ? Googled for it but no luck… 😢

You can find that information in the production log and you can parse  
it using rawk  
([Ruby on Rails Log Analyzer – RAWK | Dogpatch Happenings](http://ckhsponge.wordpress.com/2006/10/11/ruby-on-rails-log-analyzer-rawk/)  
). There’s no reason whatsoever to show the end user how long it takes  
for a page to render.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 25, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/4 "2010-01-25T15:46:28Z")

</div>

You can use a Rack Middleware. This screencast show you how to do it:

> **[\#151 Rack Middleware - RailsCasts](http://railscasts.com/episodes/151-rack-middleware)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

Best regards

* * *

```
    Agustin ViÃ±ao

```

www.agustinvinao.com.ar  
agustinvinao (Skype)

On Mon, Jan 25, 2010 at 11:39 AM, Peter De Berdt

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 25, 2010, 5:09pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/5 "2010-01-25T17:09:40Z")

</div>

Thanks for your quickies…🙂

Actually i want to write all of the information of a user into the log  
files. I mean what he do, where he do, time taken by page to load etc  
etc… So can you guys tell me the way to do it…I do not have idea about  
it…

Agustin ViÃ±ao wrote:

> You can use a Rack Middleware. This screencast show you how to do it:  
> [#151 Rack Middleware - RailsCasts](http://railscasts.com/episodes/151-rack-middleware)
> 
> Best regards
> 
> * * *
> 
> ```
> Agustin ViÃ±ao
> 
> ```
> 
> www.agustinvinao.com.ar  
> agustinvinao (Skype)
> 
> On Mon, Jan 25, 2010 at 11:39 AM, Peter De Berdt

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 25, 2010, 7:46pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/6 "2010-01-25T19:46:50Z")

</div>

Hemant B. wrote:

> Thanks for your quickies…🙂
> 
> Actually i want to write all of the information of a user into the log  
> files. I mean what he do, where he do, time taken by page to load etc  
> etc…

Rails already does this. There’s nothing further you need to do.

> So can you guys tell me the way to do it…I do not have idea about  
> it…

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 27, 2010, 9:54am UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/7 "2010-01-27T09:54:53Z")

</div>

On Jan 27, 6:23 am, Hemant B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> But how can i do it? Where does rails do it? I want to write a summary  
> like user with session id is accessing page ABC, have taken abc time…  
> etc etc. in a sinle line of log files …

By default log files go into your app’s log folder

Fred

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 27, 2010, 7:23am UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/8 "2010-01-27T07:23:12Z")

</div>

But how can i do it? Where does rails do it? I want to write a summary  
like user with session id is accessing page ABC, have taken abc time…  
etc etc. in a sinle line of log files …

Marnen Laibow-Koser wrote:

> Hemant B. wrote:
> 
> > Thanks for your quickies…🙂
> > 
> > Actually i want to write all of the information of a user into the log  
> > files. I mean what he do, where he do, time taken by page to load etc  
> > etc…
> 
> Rails already does this. There’s nothing further you need to do.
> 
> > So can you guys tell me the way to do it…I do not have idea about  
> > it…
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [January 27, 2010, 3:40pm UTC](https://www.ruby-forum.com/t/time-taken-by-page-to-load/182234/9 "2010-01-27T15:40:00Z")

</div>

Thanks guyz… Resolved it …  
Actually rails already provide this thing… I mean using “debug params”,  
you can find out that what parameters coming… And the based upon those  
parameters you can find out whatever you want… Say like you want the  
action name then type just params[:action] and you’ll get action name of  
the page… Same with any others…

Cheers …

Frederick C. wrote:

> On Jan 27, 6:23ï¿½am, Hemant B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > But how can i do it? Where does rails do it? I want to write a summary  
> > like user with session id is accessing page ABC, have taken abc time…  
> > etc etc. in a sinle line of log files …
> 
> By default log files go into your app’s log folder
> 
> Fred
