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

Version Path
mnemosyne-ruby-1.17.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.16.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.15.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.14.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.13.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.12.1 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.12.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.11.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.10.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.10.0.beta1 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.9.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.8.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.7.1 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.7.0 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.6.2 lib/mnemosyne/probes/active_record/instantiation.rb
mnemosyne-ruby-1.6.1 lib/mnemosyne/probes/active_record/instantiation.rb