Sha256: 85221da2b11170f551c2f2da743054acb5923eb1d79fed5c259c123417b9c61d
Contents?: true
Size: 805 Bytes
Versions: 15
Compression:
Stored size: 805 Bytes
Contents
module Timber module Events # The SQL query event tracks sql queries to your database. # # @note This event should be installed automatically through probes, # such as the {Probes::ActiveRecordLogSubscriber} probe. class SQLQuery < Timber::Event attr_reader :sql, :time_ms, :message def initialize(attributes) @sql = attributes[:sql] || raise(ArgumentError.new(":sql is required")) @time_ms = attributes[:time_ms] || raise(ArgumentError.new(":time_ms is required")) @message = attributes[:message] || raise(ArgumentError.new(":message is required")) end def to_hash {sql: sql, time_ms: time_ms} end alias to_h to_hash def as_json(_options = {}) {:sql_query => to_hash} end end end end
Version data entries
15 entries across 15 versions & 2 rubygems