ruby - 使用rack-mini-profiler 来分析和优化rails

访问量: 200

参考 : https://github.com/MiniProfiler/rack-mini-profiler

1. Gemfile: gem 'rack-mini-profiler', require: false

2  bundle exec rails g rack_profiler:install

会生成文件 config/initializers/rack_profiler.rb  内容如下:

if Rails.env.development?
  require "rack-mini-profiler"

  # initialization is skipped so trigger it
  Rack::MiniProfilerRails.initialize!(Rails.application)
end

订阅/RSS Feed

Subscribe

分类/category