Module: MetrixWire::Instrument::Mysql2
- Defined in:
- lib/metrixwire/instrument/mysql2.rb
Overview
Best-effort patch of the mysql2 gem (Mysql2::Client#query). Guarded:
skips silently if the gem isn't loaded.
Defined Under Namespace
Modules: Patch
Class Method Summary collapse
Class Method Details
.install ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/metrixwire/instrument/mysql2.rb', line 10 def install return unless defined?(::Mysql2::Client) return if ::Mysql2::Client.instance_variable_get(:@__metrixwire_patched) ::Mysql2::Client.prepend(Patch) ::Mysql2::Client.instance_variable_set(:@__metrixwire_patched, true) rescue StandardError nil end |