Sha256: 0feede0c66024be7ef709295b94e4d7fd09ffda9f3059271cf40fac00feb3f6a

Contents?: true

Size: 860 Bytes

Versions: 13

Compression:

Stored size: 860 Bytes

Contents

require 'benchmark'

require '3scale/client'

provider_key = ENV['TEST_3SCALE_PROVIDER_KEY']

client = ThreeScale::Client.new(:provider_key => provider_key)
persistent_client = ThreeScale::Client.new(:provider_key => provider_key, :persistent => true)
persistent_ssl_client = ThreeScale::Client.new(:provider_key => provider_key, :secure => true, :persistent => true)
ssl_client = ThreeScale::Client.new(:provider_key => provider_key, :secure => true)

auth = { :app_id => ENV['TEST_3SCALE_APP_IDS'], :app_key => ENV['TEST_3SCALE_APP_KEYS'] }

N = 10

Benchmark.bmbm do |x|
  x.report('http') { N.times{ client.authorize(auth) } }
  x.report('http+persistent') { N.times{ persistent_client.authorize(auth) } }
  x.report('https+persistent') { N.times{ persistent_ssl_client.authorize(auth) } }
  x.report('https') { N.times{ ssl_client.authorize(auth) } }
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
3scale_client-2.10.0 test/benchmark.rb
3scale_client-2.9.0 test/benchmark.rb
3scale_client-2.8.2 test/benchmark.rb
3scale_client-2.8.1 test/benchmark.rb
3scale_client-2.8.0 test/benchmark.rb
3scale_client-2.7.0 test/benchmark.rb
3scale_client-2.6.1 test/benchmark.rb
3scale_client-2.6.0 test/benchmark.rb
3scale_client-2.5.0 test/benchmark.rb
3scale_client-2.5.0.pre1 test/benchmark.rb
3scale_client-2.4.2 test/benchmark.rb
3scale_client-2.4.0 test/benchmark.rb
3scale_client-2.4.0.pre.1 test/benchmark.rb