Mini Profiler not working well, remove it

master
Eugen Rochko 8 years ago
parent b6ee2fb1c6
commit 8e34bed7cc
  1. 5
      Gemfile
  2. 9
      Gemfile.lock
  3. 5
      app/controllers/application_controller.rb
  4. 17
      config/initializers/mini_profiler.rb

@ -50,11 +50,6 @@ gem 'react-rails'
gem 'browserify-rails' gem 'browserify-rails'
gem 'autoprefixer-rails' gem 'autoprefixer-rails'
gem 'rack-mini-profiler', require: false
gem 'flamegraph'
gem 'stackprof'
gem 'memory_profiler'
group :development, :test do group :development, :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'pry-rails' gem 'pry-rails'

@ -136,7 +136,6 @@ GEM
execjs (2.7.0) execjs (2.7.0)
fabrication (2.15.2) fabrication (2.15.2)
fast_blank (1.0.0) fast_blank (1.0.0)
flamegraph (0.9.5)
font-awesome-rails (4.6.3.1) font-awesome-rails (4.6.3.1)
railties (>= 3.2, < 5.1) railties (>= 3.2, < 5.1)
fuubar (2.1.1) fuubar (2.1.1)
@ -206,7 +205,6 @@ GEM
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.6.4) mail (2.6.4)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
memory_profiler (0.9.7)
method_source (0.8.2) method_source (0.8.2)
mime-types (3.1) mime-types (3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
@ -264,8 +262,6 @@ GEM
rack-attack (5.0.1) rack-attack (5.0.1)
rack rack
rack-cors (0.4.0) rack-cors (0.4.0)
rack-mini-profiler (0.10.1)
rack (>= 1.2.0)
rack-protection (1.5.3) rack-protection (1.5.3)
rack rack
rack-test (0.6.3) rack-test (0.6.3)
@ -376,7 +372,6 @@ GEM
actionpack (>= 4.0) actionpack (>= 4.0)
activesupport (>= 4.0) activesupport (>= 4.0)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
stackprof (0.2.10)
temple (0.7.7) temple (0.7.7)
term-ansicolor (1.4.0) term-ansicolor (1.4.0)
tins (~> 1.0) tins (~> 1.0)
@ -425,7 +420,6 @@ DEPENDENCIES
dotenv-rails dotenv-rails
fabrication fabrication
fast_blank fast_blank
flamegraph
font-awesome-rails font-awesome-rails
fuubar fuubar
goldfinger goldfinger
@ -441,7 +435,6 @@ DEPENDENCIES
letter_opener letter_opener
link_header link_header
lograge lograge
memory_profiler
neography neography
nokogiri nokogiri
oj oj
@ -456,7 +449,6 @@ DEPENDENCIES
rabl rabl
rack-attack rack-attack
rack-cors rack-cors
rack-mini-profiler
rails! rails!
rails_12factor rails_12factor
rails_autolink rails_autolink
@ -471,7 +463,6 @@ DEPENDENCIES
sidekiq sidekiq
simple_form simple_form
simplecov simplecov
stackprof
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
webmock webmock
will_paginate will_paginate

@ -14,7 +14,6 @@ class ApplicationController < ActionController::Base
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller? before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
before_action :set_locale before_action :set_locale
before_action :check_rack_mini_profiler
def raise_not_found def raise_not_found
raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}" raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
@ -32,10 +31,6 @@ class ApplicationController < ActionController::Base
I18n.locale = I18n.default_locale I18n.locale = I18n.default_locale
end end
def check_rack_mini_profiler
Rack::MiniProfiler.authorize_request if current_user && current_user.admin?
end
protected protected
def not_found def not_found

@ -1,17 +0,0 @@
require 'rack-mini-profiler'
Rack::MiniProfilerRails.initialize!(Rails.application)
Rails.application.middleware.swap(Rack::Deflater, Rack::MiniProfiler)
Rails.application.middleware.swap(Rack::MiniProfiler, Rack::Deflater)
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::MemoryStore
if Rails.env.production?
Rack::MiniProfiler.config.storage_options = {
host: ENV.fetch('REDIS_HOST') { 'localhost' },
port: ENV.fetch('REDIS_PORT') { 6379 },
}
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore
end
Loading…
Cancel
Save