Sha256: d72b3f18e7b4af177f4633409617338fd8e09db062e88aba6cfb3a54a06f7b0a
Contents?: true
Size: 792 Bytes
Versions: 9
Compression:
Stored size: 792 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 IGNORED_SQL_NAMES = %w[SCHEMA CACHE].freeze private def notification_pattern NOTIFICATION_PATTERN end def payload(event) name, base = attributes_from_notification(event) payload = event.payload return if IGNORED_SQL_NAMES.include?(payload[:name]) case name when "sql" base.merge({"sql" => payload[:sql]}) when "instantiation" base.merge({"class_name" => payload[:class_name], "record_count" => payload[:record_count]}) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems