Class: ActiveRecordQueryStats::SqlEventAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record_query_stats/sql_event_analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ SqlEventAnalyzer

Returns a new instance of SqlEventAnalyzer.



7
8
9
# File 'lib/active_record_query_stats/sql_event_analyzer.rb', line 7

def initialize(event)
  @event = event
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
# File 'lib/active_record_query_stats/sql_event_analyzer.rb', line 11

def call
  return if skipping?

  increase_total
  return increase_cached if cached_query?

  increase_real
  increase_transaction_related || increase_statements || increase_other
end