0

I have a Rails app that sends multiple requests both sequentially and in parallel to a third-party API and do calculation in the backend.

I would like to know how long each of my API requests and calculation takes. Is there performance testing gem I should use?

Note: my app uses Sidekiq to process backend jobs.

1 Answer 1

0

http://guides.rubyonrails.org/performance_testing.html might get you started, check out section 3 for details of wrapping methods in "benchmark" which outputs some useful stats to the log.

As a quick example:

def process
  Benchmark.bm do |x|
    x.report("Processing Task") do 
      process_task(task_options)
    end
  end
end

would output something like:

                 user       system     total    real
Processing Task  8.206000   1.092000   9.298000 ( 14.609000)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.