Browse Source

Read instead of Load

main
pvincent 2 months 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
# FIXME: might be more accurate, multiple transactions, sum of CRUD
def pop_active_record_summary
active_record_transactions = Thread.current[ActiveRecord.to_s]
return unless active_record_transactions

4
lib/semantic/subscribers/active_record.rb

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

Loading…
Cancel
Save