MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.68k stars 400 forks source link

[BUG] Default to ActiveSupport::Notifications for pg and mysql2 #583

Closed kbrock closed 7 months ago

kbrock commented 1 year ago

Before

Per https://github.com/MiniProfiler/rack-mini-profiler/pull/418, Oracle defaults to using ActiveSupport::Notifications. Setting patch_rails? skips the notifications and uses rails.

SqlPatches.sql_patches ignores that setting and always returns ["pg"] for postgres. So it always patches Postgres, and does not have a way to leverage ActiveSupport::Notifications. The same holds with MySql.

After

Like Oracle, Postgres and MySql are checking with patch_rails? to determine if the rails code should be patched. SqlPatches.sql_patches returns [] for postgres and mysql.