Sha256: bcb1a93c07c71b6db0b445083c92ce27e07b7c94fdabc38f23ad7eb4763b44fa

Contents?: true

Size: 697 Bytes

Versions: 14

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

Dir.chdir('./bench')

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'stackprof'
require 'rack/test'
require 'elastic-apm'

ElasticAPM.start environment: 'bench'

env = Rack::MockRequest.env_for('/')

puts 'Running '
profile = StackProf.run(mode: :cpu) do
  10_000.times do
    ElasticAPM.transaction 'Name', 'custom',
      context: ElasticAPM.build_context(env) do
      ElasticAPM.span 'Number one' do
        'ok'
      end
      ElasticAPM.span 'Number two' do
        'ok'
      end
      ElasticAPM.span 'Number three' do
        'ok'
      end
    end
  end
end
puts ''

ElasticAPM.stop

StackProf::Report.new(profile).print_text

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
elastic-apm-2.8.0 bench/stackprof.rb
elastic-apm-2.7.0 bench/stackprof.rb
elastic-apm-2.6.1 bench/stackprof.rb
elastic-apm-2.6.0 bench/stackprof.rb
elastic-apm-2.5.0 bench/stackprof.rb
elastic-apm-2.4.0 bench/stackprof.rb
elastic-apm-2.3.1 bench/stackprof.rb
elastic-apm-2.3.0 bench/stackprof.rb
elastic-apm-2.2.0 bench/stackprof.rb
elastic-apm-2.1.2 bench/stackprof.rb
elastic-apm-2.1.1 bench/stackprof.rb
elastic-apm-2.1.0 bench/stackprof.rb
elastic-apm-2.0.1 bench/stackprof.rb
elastic-apm-2.0.0 bench/stackprof.rb