lib/flipper/adapters/instrumented.rb in flipper-0.8.0 vs lib/flipper/adapters/instrumented.rb in flipper-0.9.0.beta1
- old
+ new
@@ -1,12 +1,13 @@
+require 'delegate'
require 'flipper/instrumenters/noop'
module Flipper
module Adapters
# Internal: Adapter that wraps another adapter and instruments all adapter
# operations. Used by flipper dsl to provide instrumentatin for flipper.
- class Instrumented
+ class Instrumented < SimpleDelegator
include ::Flipper::Adapter
# Private: The name of instrumentation events.
InstrumentationName = "adapter_operation.#{InstrumentationNamespace}"
@@ -22,9 +23,10 @@
#
# options - The Hash of options.
# :instrumenter - What to use to instrument all the things.
#
def initialize(adapter, options = {})
+ super(adapter)
@adapter = adapter
@name = :instrumented
@instrumenter = options.fetch(:instrumenter, Instrumenters::Noop)
end