How to check speed of your requests in rails console

Category: Ruby :: Published at: 17.05.2021

If you want to check how fast is your request, and which version of your request will be more optimized, you should use Benchmark tool.

Benchmark is the tool installed with your rails app by default. It gives you a lot of interesting data about your request performance.

2.7.1 :002 > Benchmark.measure { User.all }
 => #<Benchmark::Tms:0x00007f8eaab78c58 @label="", @real=0.023035000078380108, @cstime=0.0, @cutime=0.0, @stime=0.008591000000000001, @utime=0.012364000000000042, @total=0.020955000000000043>


- Click if you liked this article

Views: 67