Skip to content

Commit

Permalink
Install rack-mini-profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
awead committed Aug 13, 2021
1 parent a2633de commit bfbc217
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ gem 'ddtrace', '~> 0.48.0'
gem 'devise', '>= 4.6.0'
gem 'devise-guests', '~> 0.6'
gem 'faraday'
gem 'flamegraph'
gem 'high_voltage', '~> 3.1'
gem 'lograge'
gem 'memory_profiler'
gem 'puma', '~> 4.3'
gem 'rack-mini-profiler'
gem 'rails', '~> 6.0.4'
gem 'redis', '~> 4.2'
gem 'rsolr', '>= 1.0'
gem 'rubyzip'
gem 'stackprof'
gem 'webpacker'

gem 'blacklight'
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ GEM
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
flamegraph (0.9.5)
foreman (0.63.0)
dotenv (>= 0.7)
thor (>= 0.13.6)
Expand Down Expand Up @@ -253,6 +254,7 @@ GEM
marc-fastxmlwriter (1.0.0)
marc (~> 1.0)
marcel (1.0.1)
memory_profiler (1.0.0)
method_source (1.0.0)
mini_mime (1.1.0)
mini_portile2 (2.5.3)
Expand Down Expand Up @@ -291,6 +293,8 @@ GEM
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
rack-mini-profiler (2.3.2)
rack (>= 1.2.0)
rack-protection (2.1.0)
rack
rack-proxy (0.6.5)
Expand Down Expand Up @@ -424,6 +428,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
stackprof (0.2.17)
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
Expand Down Expand Up @@ -493,14 +498,17 @@ DEPENDENCIES
devise (>= 4.6.0)
devise-guests (~> 0.6)
faraday
flamegraph
foreman (~> 0.63.0)
high_voltage (~> 3.1)
listen (>= 3.0.5, < 3.2)
lograge
memory_profiler
mysql2 (>= 0.4.4, < 0.6.0)
niftany (~> 0.9)
pry-byebug
puma (~> 4.3)
rack-mini-profiler
rails (~> 6.0.4)
rails-controller-testing
redis (~> 4.2)
Expand All @@ -514,6 +522,7 @@ DEPENDENCIES
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
stackprof
vcr
web-console
webdrivers (~> 4.0)
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ class ApplicationController < ActionController::Base
ActionController::Parameters.permit_all_parameters = true

helper_method :blackcat_config

before_action do
# @todo Need to limit this to admin users only
Rack::MiniProfiler.authorize_request
end
end
8 changes: 8 additions & 0 deletions config/initializers/mini_profiler.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

# Do not let rack-mini-profiler disable caching
Rack::MiniProfiler.config.disable_caching = false

# Store data in Redis, which can be shared accross multiple containers
Rack::MiniProfiler.config.storage_options = { url: Settings.redis.sessions.uri }
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore

0 comments on commit bfbc217

Please sign in to comment.