Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bundler.d/profiling.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
group :profiling, optional: true do
gem 'rack-mini-profiler'

# For memory profiling
gem 'memory_profiler'

# For call-stack profiling flamegraphs
gem 'stackprof'
end
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Bundler.ui = Bundler::UI::Silent.new if Rails.env.production?

Bundler.require(*Rails.groups)
optional_bundler_groups = %w[assets ec2 fog libvirt openstack vmware redis]
optional_bundler_groups = %w[assets ec2 fog libvirt openstack profiling vmware redis]
optional_bundler_groups.each do |group|
Bundler.require(group)
rescue LoadError
Expand Down
7 changes: 7 additions & 0 deletions config/initializers/rack_mini_profiler.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if defined? Rack::MiniProfiler
# enable profiling for all pages; per-default it is disabled on production-env
Rack::MiniProfiler.config.authorization_mode = SETTINGS.fetch(:profiler_authorization_mode, :allow_all)

# enable additional profiling-features
Rack::MiniProfiler.config.enable_advanced_debugging_tools = true
end
4 changes: 4 additions & 0 deletions config/settings.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@
# :options:
# :compress: true
# :namespace: foreman

# set to :allow_authorized to not run rack-mini-profiler on all pages
# see https://github.com/MiniProfiler/rack-mini-profiler#access-control-in-non-development-environments
# :profiler_authorization_mode: :allow_all