replace bullet with mini_profiler

This commit is contained in:
Peter Bhat Harkins 2020-08-26 19:09:40 -05:00
parent 59b15fbfa5
commit 3ee84d4a47
5 changed files with 23 additions and 12 deletions

View File

@ -34,6 +34,12 @@ gem "nokogiri", ">= 1.10.8"
gem "htmlentities"
gem "commonmarker", "~> 0.14"
# perf
gem 'flamegraph'
gem 'memory_profiler'
gem 'rack-mini-profiler'
gem 'stackprof'
gem "oauth" # for twitter-posting bot
gem "mail" # for parsing incoming mail
gem "ruumba" # tests views
@ -42,7 +48,6 @@ gem "svg-graph", require: 'SVG/Graph/TimeSeries' # for charting, note workaround
gem 'transaction_retry' # mitigate https://github.com/lobsters/lobsters-ansible/issues/39
group :test, :development do
gem 'bullet'
gem 'capybara'
gem 'database_cleaner'
gem 'good_migrations'

View File

@ -67,9 +67,6 @@ GEM
ast (2.4.1)
bcrypt (3.1.15)
builder (3.2.4)
bullet (6.1.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
capybara (3.33.0)
addressable
@ -102,6 +99,7 @@ GEM
faker (2.13.0)
i18n (>= 1.6, < 2)
ffi (1.13.1)
flamegraph (0.9.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
good_migrations (0.0.2)
@ -128,6 +126,7 @@ GEM
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
memory_profiler (0.9.14)
method_source (1.0.0)
mimemagic (0.3.5)
mini_mime (1.0.2)
@ -151,6 +150,8 @@ GEM
puma (4.3.5)
nio4r (~> 2.0)
rack (2.2.3)
rack-mini-profiler (2.0.4)
rack (>= 1.2.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.2)
@ -249,6 +250,7 @@ GEM
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
stackprof (0.2.15)
svg-graph (2.2.0)
thor (1.0.1)
thread_safe (0.3.6)
@ -263,7 +265,6 @@ GEM
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.7.0)
uniform_notifier (1.13.0)
vcr (6.0.0)
webmock (3.8.3)
addressable (>= 2.3.6)
@ -283,7 +284,6 @@ DEPENDENCIES
actionpack-page_caching
activerecord-typedstore
bcrypt (~> 3.1.2)
bullet
byebug
capybara
commonmarker (~> 0.14)
@ -291,17 +291,20 @@ DEPENDENCIES
exception_notification
factory_bot_rails
faker
flamegraph
good_migrations
htmlentities
jquery-rails (~> 4.3)
json
listen
mail
memory_profiler
mysql2
nokogiri (>= 1.10.8)
oauth
pdf-reader
puma
rack-mini-profiler
rails (~> 6.0.3.2)
rb-readline
rotp
@ -316,6 +319,7 @@ DEPENDENCIES
simplecov
sitemap_generator
sprockets-rails (= 2.3.3)
stackprof
svg-graph
transaction_retry
uglifier (>= 1.3.0)

View File

@ -3,6 +3,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
before_action :authenticate_user
before_action :mini_profiler
before_action :set_traffic_style
before_action :prepare_exception_notifier
@ -55,6 +56,12 @@ class ApplicationController < ActionController::Base
)
end
def mini_profiler
if @user && @user.is_admin?
Rack::MiniProfiler.authorize_request
end
end
# https://web.archive.org/web/20180108083712/http://umaine.edu/lobsterinstitute/files/2011/12/LobsterColorsWeb.pdf
def set_traffic_style
@traffic_intensity = '?'

View File

@ -56,12 +56,6 @@ Rails.application.configure do
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.after_initialize do
Bullet.enable = true
Bullet.console = true
Bullet.rails_logger = true
end
end
Keybase.DOMAIN = Rails.application.domain

View File

@ -0,0 +1 @@
Rack::MiniProfiler.config.disable_caching = false