Browse Source

Read instead of Load

main
pvincent 4 weeks ago
parent
commit
27f243af35
  1. 1
      lib/semantic/subscribers/action_controller.rb
  2. 4
      lib/semantic/subscribers/active_record.rb

1
lib/semantic/subscribers/action_controller.rb

@ -95,6 +95,7 @@ module Semantic
private private
# FIXME: might be more accurate, multiple transactions, sum of CRUD
def pop_active_record_summary def pop_active_record_summary
active_record_transactions = Thread.current[ActiveRecord.to_s] active_record_transactions = Thread.current[ActiveRecord.to_s]
return unless active_record_transactions return unless active_record_transactions

4
lib/semantic/subscribers/active_record.rb

@ -20,12 +20,12 @@ module Semantic
name = "#{category} #{model}" name = "#{category} #{model}"
when 'Load' when 'Load'
if event.payload[:cached] if event.payload[:cached]
name = "Cache #{model}"
name = "Cache Read #{model}"
no_stats = true no_stats = true
else else
statement_taint = TEXT_BLUE statement_taint = TEXT_BLUE
row_count = event.payload[:row_count] row_count = event.payload[:row_count]
name = "#{category} #{row_count} #{model.pluralize(row_count)}"
name = "Read #{row_count} #{model.pluralize(row_count)}"
end end
when 'Update', 'Create', 'Destroy' when 'Update', 'Create', 'Destroy'
statement_taint = TEXT__PINK statement_taint = TEXT__PINK

Loading…
Cancel
Save