feat: add rack-mini-profiler for performance monitoring

- Include 'rack-mini-profiler' gem in Gemfile
- Update Gemfile.lock with the new dependency
- Create initializer for rack-mini-profiler in development

This addition allows for performance monitoring within the
application during development, which can help identify
and address performance issues more effectively.
This commit is contained in:
songtianlun 2025-02-14 10:47:16 +08:00
parent 1c13b89854
commit ec8f89e07a
3 changed files with 13 additions and 1 deletions

View File

@ -80,7 +80,8 @@ group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
gem 'bullet', '~> 8.0'
gem "bullet", "~> 8.0"
gem "rack-mini-profiler", "~> 3.3"
end
group :production do

View File

@ -319,6 +319,8 @@ GEM
raabro (1.4.0)
racc (1.8.1)
rack (3.1.9)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-session (2.1.0)
base64 (>= 0.1.0)
rack (>= 3.0.0)
@ -537,6 +539,7 @@ DEPENDENCIES
pg (~> 1.5)
propshaft
puma (>= 5.0)
rack-mini-profiler (~> 3.3)
rails (~> 8.0.1)
rubocop-rails-omakase
ruby-openai (~> 7.3)

View File

@ -0,0 +1,8 @@
# frozen_string_literal: true
if Rails.env.development?
require "rack-mini-profiler"
# The initializer was required late, so initialize it manually.
# Rack::MiniProfilerRails.initialize!(Rails.application)
end