rack-mini-profiler

This commit is contained in:
f 2020-05-11 18:56:42 -03:00
parent b4fc837ecb
commit d63f7a75e9
3 changed files with 18 additions and 2 deletions

View file

@ -70,6 +70,12 @@ gem 'validates_hostname'
gem 'webpacker' gem 'webpacker'
gem 'yaml_db', git: 'https://0xacab.org/sutty/yaml_db.git' gem 'yaml_db', git: 'https://0xacab.org/sutty/yaml_db.git'
# performance
gem 'flamegraph'
gem 'memory_profiler'
gem 'rack-mini-profiler'
gem 'stackprof'
group :themes do group :themes do
gem 'editorial-autogestiva-jekyll-theme', require: false gem 'editorial-autogestiva-jekyll-theme', require: false
gem 'minima', require: false gem 'minima', require: false
@ -87,7 +93,6 @@ group :development, :test do
gem 'capybara', '~> 2.13' gem 'capybara', '~> 2.13'
gem 'selenium-webdriver' gem 'selenium-webdriver'
gem 'sqlite3' gem 'sqlite3'
gem 'stackprof'
end end
group :development do group :development do
@ -106,4 +111,3 @@ group :test do
gem 'factory_bot_rails' gem 'factory_bot_rails'
gem 'timecop' gem 'timecop'
end end

View file

@ -158,6 +158,7 @@ GEM
factory_bot (~> 5.1.0) factory_bot (~> 5.1.0)
railties (>= 4.2.0) railties (>= 4.2.0)
ffi (1.12.2) ffi (1.12.2)
flamegraph (0.9.5)
forwardable-extended (2.6.0) forwardable-extended (2.6.0)
friendly_id (5.3.0) friendly_id (5.3.0)
activerecord (>= 4.0.0) activerecord (>= 4.0.0)
@ -289,6 +290,8 @@ GEM
pundit (2.1.0) pundit (2.1.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
rack (2.2.2) rack (2.2.2)
rack-mini-profiler (2.0.1)
rack (>= 1.2.0)
rack-proxy (0.6.5) rack-proxy (0.6.5)
rack rack
rack-test (1.1.0) rack-test (1.1.0)
@ -472,6 +475,7 @@ DEPENDENCIES
email_address email_address
exception_notification exception_notification
factory_bot_rails factory_bot_rails
flamegraph
friendly_id friendly_id
haml-lint haml-lint
hamlit-rails hamlit-rails
@ -484,6 +488,7 @@ DEPENDENCIES
letter_opener letter_opener
listen (>= 3.0.5, < 3.2) listen (>= 3.0.5, < 3.2)
lograge lograge
memory_profiler
mini_magick mini_magick
minima minima
mobility mobility
@ -491,6 +496,7 @@ DEPENDENCIES
pry pry
puma puma
pundit pundit
rack-mini-profiler
rails (~> 6) rails (~> 6)
rails-i18n rails-i18n
rails_warden rails_warden

View file

@ -9,6 +9,12 @@ class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller? before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_locale before_action :set_locale
before_action do
if current_usuarie.try(:ends_with?, '@' + ENV.fetch('SUTTY', 'sutty.nl'))
Rack::MiniProfiler.authorize_request
end
end
# No tenemos índice de sutty, vamos directamente a ver el listado de # No tenemos índice de sutty, vamos directamente a ver el listado de
# sitios # sitios
def index def index