From 75ea19237c67f02419115c52c4907937f92a9e90 Mon Sep 17 00:00:00 2001 From: komagata Date: Fri, 12 Nov 2021 17:22:58 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88?= =?UTF-8?q?=E3=81=A7=E3=81=AFrack-mini-profiler=E3=82=92disable=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++++ config/initializers/rack-mini-profiler.rb | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 config/initializers/rack-mini-profiler.rb diff --git a/README.md b/README.md index 1ac43e9165d..3bcab59678d 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,13 @@ $ eslint 'app/javascript/**/*.{js,vue}' --fix $ prettier app/javascript/**/*.{js,vue} --write ``` +## Profiler + +rack-mini-profilerによりプロファイリングはデフォルトではOFFになっています。ONにする場合は下記のようにサーバーと立ち上げます。 + +``` +$ PROFILE=1 rails server +``` ## その他 diff --git a/config/initializers/rack-mini-profiler.rb b/config/initializers/rack-mini-profiler.rb new file mode 100644 index 00000000000..e24f53e5fa8 --- /dev/null +++ b/config/initializers/rack-mini-profiler.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +if defined?(Rack::MiniProfiler) + Rack::MiniProfiler.config.auto_inject = !!ENV['PROFILE'] +end