From 3fcecd59a86fec29249d0c50d480ab0220bcf9bb Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 16 Dec 2021 00:24:46 -0600 Subject: [PATCH] Add derailed_benchmarks gem. --- Gemfile | 1 + Gemfile.lock | 18 ++++++++++++++++++ app/assets/config/manifest.js | 8 ++++++++ config/storage.yml | 7 +++++++ 4 files changed, 34 insertions(+) create mode 100644 app/assets/config/manifest.js create mode 100644 config/storage.yml diff --git a/Gemfile b/Gemfile index f6239329b..06736b322 100644 --- a/Gemfile +++ b/Gemfile @@ -69,6 +69,7 @@ group :development do gem 'benchmark-ips', require: "benchmark/ips" gem 'listen' gem 'solargraph' + gem 'derailed_benchmarks' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 75536f6f8..0df03aa0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -132,6 +132,7 @@ GEM crass (1.0.6) daemons (1.4.1) dante (0.2.0) + dead_end (3.1.0) debug_inspector (1.1.0) declarative (0.0.20) delayed_job (4.1.9) @@ -139,6 +140,18 @@ GEM delayed_job_active_record (4.1.6) activerecord (>= 3.0, < 6.2) delayed_job (>= 3.0, < 5) + derailed_benchmarks (2.1.1) + benchmark-ips (~> 2) + dead_end + get_process_mem (~> 0) + heapy (~> 0) + memory_profiler (>= 0, < 2) + mini_histogram (>= 0.3.0) + rack (>= 1) + rack-test + rake (> 10, < 14) + ruby-statistics (>= 2.1) + thor (>= 0.19, < 2) diff-lcs (1.4.4) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -225,6 +238,8 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) + heapy (0.2.0) + thor hsluv (1.0.1) http (4.4.1) addressable (~> 2.3) @@ -262,6 +277,7 @@ GEM rack-contrib (>= 1.1, < 3) railties (>= 3.0.0, < 7) method_source (1.0.0) + mini_histogram (0.3.1) mini_mime (1.1.2) mini_portile2 (2.6.1) minitest (5.15.0) @@ -389,6 +405,7 @@ GEM rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) ruby-progressbar (1.11.0) + ruby-statistics (3.0.0) ruby-vips (2.1.4) ffi (~> 1.12) ruby2_keywords (0.0.5) @@ -502,6 +519,7 @@ DEPENDENCIES daemons delayed_job delayed_job_active_record + derailed_benchmarks diff-lcs dotenv-rails dtext_rb! diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 000000000..9b9c1130f --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,8 @@ +// This is the config file for Sprockets. Danbooru doesn't use Sprockets, but +// we still need this file anyway because the derailed_benchmarks gem doesn't +// work without it. derailed_benchmarks does `require "rails/all"`, which loads +// Sprockets, which fails if this config file isn't present. +// +// https://github.com/rails/sprockets-rails/issues/444 +// https://github.com/zombocom/derailed_benchmarks +{} diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 000000000..3c1a017ea --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,7 @@ +# This is the config file for Active Storage. Danbooru doesn't use Active +# Storage, but we still need this file anyway because the derailed_benchmarks +# gem doesn't work without it. derailed_benchmarks does `require "rails/all"`, +# which loads Active Storage, which fails if this config file isn't present. +# +# https://edgeguides.rubyonrails.org/active_storage_overview.html#setup +# https://github.com/zombocom/derailed_benchmarks