rack-mini-profiler

How to profile a rails controller that returns a json response with rack-mini-profiler?

本小妞迷上赌 提交于 2020-01-14 07:03:48
问题 I am using rack-mini-profiler in my rails 3.2 project. In gemfile: gem 'rack-mini-profiler' Everything works great. But my application is mostly a set of json endpoints. So while it is very useful to be to able to inspect the performance of html pages, I would like to also be able to see the performance of controllers that return json. Example of my controller: class UsersController < BaseController def json_method # you don't see the mini profiler ui for this controller render json: { users: