Sha256: 30e73412d559b030f2b90845cd0b17863dced957af579907e647d726b9382a54
Contents?: true
Size: 824 Bytes
Versions: 16
Compression:
Stored size: 824 Bytes
Contents
# frozen_string_literal: true module Mnemosyne module Probes module ActiveRecord module Instantiation class Probe < ::Mnemosyne::Probe subscribe 'instantiation.active_record' def call(trace, _name, start, finish, _id, payload) start = ::Mnemosyne::Clock.to_tick(start) finish = ::Mnemosyne::Clock.to_tick(finish) meta = { count: payload[:record_count], class_name: payload[:class_name] } span = ::Mnemosyne::Span.new 'db.instantiation.active_record', start: start, finish: finish, meta: meta trace << span end end end end register 'ActiveRecord::Base', 'active_record', ActiveRecord::Instantiation::Probe.new end end
Version data entries
16 entries across 16 versions & 1 rubygems