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.



60
61
62
63
64
65
66
# File 'lib/rom/plugins/relation/sql/instrumentation.rb', line 60

def initialize(name, notifications)
  super()

  @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.



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

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.



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

def notifications
  @notifications
end