Sha256: bbf61385bdf2900b60d3a8bcf2ad13a4e46c122f5ad4403924dc3a2e0a9b184f

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

# Copyright (c) 2017 SolarWinds, LLC.
# All rights reserved.

require 'benchmark/ips'
require 'benchmark/memory'
require_relative '../../minitest_helper'

# compare logging when testing for loaded versus tracing?
ENV['APPOPTICS_GEM_VERBOSE'] = 'false'
ENV['DBTYPE'] = "postgresql" unless ENV['DBTYPE']

def dostuff(uri)
  n = 100
  n.times do
    Net::HTTP.get_response(uri)
  end
end


Benchmark.memory do |x|
  AppOpticsAPM::Config[:action_controller][:collect_backtraces] = false
  # x.config(:time => 20, :warmup => 20, :iterations => 3)
  uri = URI.parse('http://127.0.0.1:8140/hello/world')

  x.report('controller_A') do
    ENV['TEST_AB'] = 'A'
    AppOpticsAPM.loaded = true
    AppOpticsAPM::Config[:tracing_mode] = 'always'
    AppOpticsAPM::Context.fromString('2B7435A9FE510AE4533414D425DADF4E180D2B4E3649E60702469DB05F00')

    dostuff(uri)
  end
  x.report('controller_B') do
    ENV['TEST_AB'] = 'B'
    AppOpticsAPM.loaded = true
    AppOpticsAPM::Config[:tracing_mode] = 'always'
    AppOpticsAPM::Context.fromString('2B7435A9FE510AE4533414D425DADF4E180D2B4E3649E60702469DB05F00')

    dostuff(uri)
  end

  x.compare!
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appoptics_apm-4.0.3 test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb
appoptics_apm-4.0.2 test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb
appoptics_apm-4.0.1-x86_64-linux test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb