Module: NetworkResiliency::Adapter::Postgres

Extended by:
Postgres
Included in:
Postgres
Defined in:
lib/network_resiliency/adapter/postgres.rb

Defined Under Namespace

Modules: Instrumentation

Instance Method Summary collapse

Instance Method Details

#patchObject



9
10
11
12
13
# File 'lib/network_resiliency/adapter/postgres.rb', line 9

def patch
  return if patched?

  PG::Connection.singleton_class.prepend(Instrumentation)
end

#patched?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/network_resiliency/adapter/postgres.rb', line 15

def patched?
  PG::Connection.singleton_class.ancestors.include?(Instrumentation)
end