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.

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.


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

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.


51
52
53
# File 'lib/rom/plugins/relation/sql/instrumentation.rb', line 51

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.


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

def notifications
  @notifications
end