Published on
1 min read

Profile API endpoints Using rack-mini-profiler

Authors

rack-mini-profiler is an excellent tool for fine-tuning Rails applications. It provides detailed query information and execution times for web pages.

rack-mini-profiler

While it's simple to use for HTML pages, it doesn't provide a direct way to view API endpoint performance. However, you can leverage its feature of collecting previous JSON calls and displaying them on the next HTML page load.

Steps to profile an API request:

  1. Make your API request using a client like Postman.
  2. Reload any HTML page in your app (e.g., http://localhost:3000/404.html).
  3. The mini-profiler badge on that page will show the profiling information for the previous API call.
API Profiling Result
TwitterLinkedInHacker News