Sha256: 76febafdf2bb1a9777fca9b8497c81237cb21460b17f849cad0fb66774517d30

Contents?: true

Size: 790 Bytes

Versions: 17

Compression:

Stored size: 790 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

class TestClass
  def method_1
    trace_execution_scoped(['a', 'b']) do
    end
  end

  def method_2
    callback = Proc.new { ['c', 'd'] }
    trace_execution_scoped(['a', 'b'], { :additional_metrics_callback => callback }) do
    end
  end
end

class TraceExecutionScopedTests < Performance::TestCase
  def setup
    @test_class = TestClass.new
    TestClass.instance_eval('include NewRelic::Agent::MethodTracer')
    require 'new_relic/agent/method_tracer'
  end

  def test_without_callback
    iterations.times { @test_class.method_1 }
  end

  def test_with_callback
    iterations.times { @test_class.method_2 }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
newrelic_rpm-3.10.0.279 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.9.275 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.8.273 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.7.266 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.6.257 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.5.251 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.4.245 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.3.241 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.2.239 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.1.236 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.9.0.229 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.8.1.221 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.8.0.218 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.7.3.204 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.7.3.199 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.7.2.195 test/performance/suites/trace_execution_scoped.rb
newrelic_rpm-3.7.2.192 test/performance/suites/trace_execution_scoped.rb