diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2016-09-22 15:00:30 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2016-09-22 15:30:45 +0200 |
commit | 84d35da86c14767c737783cb95dd4624632cc1bd (patch) | |
tree | 487f03efc3f82c571c7bc6510f58554dfbfaeecc /activerecord/lib/active_record/explain_subscriber.rb | |
parent | 19966242163611e61d45ee4033f28aa6f967906a (diff) | |
download | rails-84d35da86c14767c737783cb95dd4624632cc1bd.tar.gz rails-84d35da86c14767c737783cb95dd4624632cc1bd.tar.bz2 rails-84d35da86c14767c737783cb95dd4624632cc1bd.zip |
Preserve cached queries name in AS notifications
Diffstat (limited to 'activerecord/lib/active_record/explain_subscriber.rb')
-rw-r--r-- | activerecord/lib/active_record/explain_subscriber.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/explain_subscriber.rb b/activerecord/lib/active_record/explain_subscriber.rb index 706b57842f..abd8cfc8f2 100644 --- a/activerecord/lib/active_record/explain_subscriber.rb +++ b/activerecord/lib/active_record/explain_subscriber.rb @@ -18,10 +18,13 @@ module ActiveRecord # # On the other hand, we want to monitor the performance of our real database # queries, not the performance of the access to the query cache. - IGNORED_PAYLOADS = %w(SCHEMA EXPLAIN CACHE) + IGNORED_PAYLOADS = %w(SCHEMA EXPLAIN) EXPLAINED_SQLS = /\A\s*(with|select|update|delete|insert)\b/i def ignore_payload?(payload) - payload[:exception] || IGNORED_PAYLOADS.include?(payload[:name]) || payload[:sql] !~ EXPLAINED_SQLS + payload[:exception] || + payload[:cached] || + IGNORED_PAYLOADS.include?(payload[:name]) || + payload[:sql] !~ EXPLAINED_SQLS end ActiveSupport::Notifications.subscribe("sql.active_record", new) |