Class: ROM::Plugins::Relation::SQL::Instrumentation::Instrumenter Private

Inherits:
Module
  • Object
show all
Defined in:
lib/rom/plugins/relation/sql/instrumentation.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This stateful module is used to extend database connection objects and monkey-patches ‘log_connection_yield` method, which unfortunately is the only way to provide instrumentation on the sequel side.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, notifications) ⇒ Instrumenter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Instrumenter.

API:

  • private



56
57
58
59
60
# File 'lib/rom/plugins/relation/sql/instrumentation.rb', line 56

def initialize(name, notifications)
  @name = name
  @notifications = notifications
  define_log_connection_yield
end

Instance Attribute Details

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



49
50
51
# File 'lib/rom/plugins/relation/sql/instrumentation.rb', line 49

def name
  @name
end

#notificationsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



53
54
55
# File 'lib/rom/plugins/relation/sql/instrumentation.rb', line 53

def notifications
  @notifications
end