Skip to content

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

Merged
nateberkopec merged 1 commit intoMiniProfiler:masterfrom
kbrock:active_support_notifications_pg
Dec 6, 2023
Merged

[BUG] Default to ActiveSupport::Notifications for pg and mysql2#583
nateberkopec merged 1 commit intoMiniProfiler:masterfrom
kbrock:active_support_notifications_pg

Conversation

@kbrock
Copy link
Contributor

@kbrock kbrock commented Jun 8, 2023

Before

Per #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.

background: MiniProfiler#418

By default, rack mini profiler is expected to use active support notifications

Before
======

Oracle is working as described, but pg and mysql are not.

SqlPatches.sql_patches returns ["pg"] for postgres, patches postgres,
and does not leverage ActiveSupport::Notifications

After
=====

Like oracle, postgres and mysql are double checking with patch_rails? to determine if the
rails code should be patched.

SqlPatches.sql_patches returns [] for postgres
@kbrock kbrock changed the title Default to ActiveSupport::Notifications for pg and mysql2 [BUG] Default to ActiveSupport::Notifications for pg and mysql2 Jun 15, 2023
@nateberkopec nateberkopec merged commit f564b12 into MiniProfiler:master Dec 6, 2023
@kbrock kbrock deleted the active_support_notifications_pg branch December 6, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants