Sha256: 641898e9e3738c5d22531b86357e583a194960480c40dab8635fb346ff47b170

Contents?: true

Size: 1.33 KB

Versions: 18

Compression:

Stored size: 1.33 KB

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 TransactionTracingPerfTests < Performance::TestCase
  def klass(instrument)
    Class.new do
      def self.name
        "CustomClass#{object_id}"
      end

      def short_transaction
        method_4
      end

      def long_transaction(n)
        n.times do
          method_1
        end
      end

      def method_1
        method_2
        method_3
      end

      def method_2
      end

      def method_3
      end

      def method_4
      end

      if instrument
        include NewRelic::Agent::Instrumentation::ControllerInstrumentation
        include NewRelic::Agent::MethodTracer
        add_method_tracer :method_1
        add_method_tracer :method_2
        add_method_tracer :method_3
        add_method_tracer :method_4
        add_transaction_tracer :short_transaction
        add_transaction_tracer :long_transaction
      end

    end
  end

  def setup
    @dummy = klass(true).new
    NewRelic::Agent.manual_start(:developer_mode => false)
  end

  def teardown
    NewRelic::Agent.shutdown
  end

  def test_short_transactions
    iterations.times { @dummy.short_transaction }
  end

  def test_long_transactions
    @dummy.long_transaction(iterations)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
newrelic_rpm-3.8.0.218 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.3.204 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.3.199 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.2.195 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.2.192 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.2.190.beta test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.1.188 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.1.182 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.1.180 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.0.177 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.7.0.174.beta test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.9.171 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.8.168 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.8.164 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.7.159 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.7.159.beta test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.7.152 test/performance/suites/transaction_tracing.rb
newrelic_rpm-3.6.6.147 test/performance/suites/transaction_tracing.rb