class RorVsWild::Plugin::ActiveRecord
def publish_event(event)
def publish_event(event) section = Section.new section.total_ms = event.payload[:lock_wait] section.async_ms = event.duration - event.payload[:lock_wait] section.gc_time_ms = event.respond_to?(:gc_time) ? event.gc_time : 0 # gc_time since Rails 7.2.0 section.commands << normalize_sql_query(event.payload[:sql]) section.kind = "sql" (parent = Section.current) && parent.children_ms += section.total_ms execution = RorVsWild.agent.current_execution and execution.add_section(section) end