Sha256: e9cc40bbc6d70fddb417e32ed6891ae45cfaf1036b3d31cc09dd95f5043339a7

Contents?: true

Size: 674 Bytes

Versions: 22

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

module Mnemosyne
  class Probe
    include ::Mnemosyne::Logging

    def install
      setup

      self.class.subscriptions.each do |subscribe|
        ::ActiveSupport::Notifications.subscribe(subscribe) do |*args|
          trace = ::Mnemosyne::Instrumenter.current_trace
          next unless trace

          call(trace, *args)
        end
      end

      logger.debug(Mnemosyne) { "Installed probe #{self.class.name}" }
    end

    def setup
      # noop
    end

    class << self
      def subscriptions
        @subscriptions ||= Set.new
      end

      def subscribe(name)
        subscriptions << name
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
mnemosyne-ruby-2.0.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.17.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.16.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.15.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.14.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.13.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.12.1 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.12.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.11.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.10.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.10.0.beta1 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.9.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.8.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.7.1 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.7.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.6.2 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.6.1 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.5.1 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.5.0 lib/mnemosyne/probe.rb
mnemosyne-ruby-1.4.0 lib/mnemosyne/probe.rb