Sha256: aa1b0d0f854ed87d262523bc7e1abce045234cdf031ed036cdad902f596663ac
Contents?: true
Size: 913 Bytes
Versions: 14
Compression:
Stored size: 913 Bytes
Contents
# frozen_string_literal: true require_relative "active_support_subscriber" module PlainApm module Hooks class ActiveRecord < ActiveSupportSubscriber NOTIFICATION_PATTERN = /\A[^!]\w+\.active_record\Z/.freeze private def notification_pattern NOTIFICATION_PATTERN end def payload(event) name, source = *event.name.split(".") payload = event.payload base = { "source" => source, "name" => name, "backtrace" => filtered_backtrace, "started_at" => event.time, "finished_at" => event.end, "allocations" => event.allocations, "thread_allocations" => event.thread_allocations } case name when "sql" base.merge({ "sql_name" => payload[:name], "sql" => payload[:sql] }) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems