Sha256: 882fb784f4c530ca6585af6cb6e6d5bb43ab7ebbf483be560ee0026803a158ce

Contents?: true

Size: 652 Bytes

Versions: 20

Compression:

Stored size: 652 Bytes

Contents

require 'bundler/setup'
require 'flipper'
require 'active_support/notifications'
require 'active_support/isolated_execution_state'
require 'benchmark/ips'

class FlipperSubscriber
  def call(name, start, finish, id, payload)
  end

  ActiveSupport::Notifications.subscribe(/flipper/, new)
end

actor = Flipper::Actor.new("User;1")
bare = Flipper.new(Flipper::Adapters::Memory.new)
instrumented = Flipper.new(Flipper::Adapters::Memory.new, instrumenter: ActiveSupport::Notifications)

Benchmark.ips do |x|
  x.report("with instrumentation") { instrumented.enabled?(:foo, actor) }
  x.report("without instrumentation") { bare.enabled?(:foo, actor) }
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
flipper-1.3.2 benchmark/instrumentation_ips.rb
flipper-1.3.1 benchmark/instrumentation_ips.rb
flipper-1.3.0 benchmark/instrumentation_ips.rb
flipper-1.3.0.pre benchmark/instrumentation_ips.rb
flipper-1.2.2 benchmark/instrumentation_ips.rb
flipper-1.2.1 benchmark/instrumentation_ips.rb
flipper-1.2.0 benchmark/instrumentation_ips.rb
flipper-1.1.2 benchmark/instrumentation_ips.rb
flipper-1.1.1 benchmark/instrumentation_ips.rb
flipper-1.1.0 benchmark/instrumentation_ips.rb
flipper-1.0.0 benchmark/instrumentation_ips.rb
flipper-1.0.0.pre benchmark/instrumentation_ips.rb
flipper-0.28.3 benchmark/instrumentation_ips.rb
flipper-0.28.2 benchmark/instrumentation_ips.rb
flipper-0.28.1 benchmark/instrumentation_ips.rb
flipper-0.28.0 benchmark/instrumentation_ips.rb
flipper-0.27.1 benchmark/instrumentation_ips.rb
flipper-0.27.0 benchmark/instrumentation_ips.rb
flipper-0.26.2 benchmark/instrumentation_ips.rb
flipper-0.26.1 benchmark/instrumentation_ips.rb