Topic: How is reqs/sec calculated ?

Hello,

In the Rails log files (production), how is the requests per second number calculated ? For example, in this line:

Completed in 0.00087 (1146 reqs/sec) | DB: 0.00000 (0%) | 302 Found [http://www.myapp.com]
Completed in 0.19176 (5 reqs/sec) | Rendering: 0.15716 (81%) | DB: 0.00550 (2%) | 200 OK [http://www.myapp.com]
Completed in 0.11467 (8 reqs/sec) | Rendering: 0.07869 (68%) | DB: 0.00540 (4%) | 200 OK [http://www.myapp.com]


How are these numbers 1146, 5 and 8 in the above log output derived by Rails ?


Thanks,
Kannan

Re: How is reqs/sec calculated ?

"Completed in 0.19176" means it took 0.19 seconds to serve a single request, from there its basic math to get 5 reqs/second.

Getting to the 0.19176 number is just a matter of noting the time that we got the request and the time that the page was rendered and sent.