Sha256: 0c9696adcf7dffcf478d711a37691677413bd066d65ee5ced475ca92c87851e1

Contents?: true

Size: 1007 Bytes

Versions: 18

Compression:

Stored size: 1007 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 NewRelic::TransactionSample::SubTest < Minitest::Test
  def setup
    @t = NewRelic::TransactionSample.new

    @t.params[:test] = "hi"

    s1 = @t.create_segment(1.0, "controller")

    @t.root_segment.add_called_segment(s1)

    s2 = @t.create_segment(2.0, "AR1")

    s2.params[:test] = "test"

    s1.add_called_segment(s2)
    s2.end_trace 3.0
    s1.end_trace 4.0

    s3 = @t.create_segment(4.0, "post_filter")
    @t.root_segment.add_called_segment(s3)
    s3.end_trace 6.0

    s4 = @t.create_segment(6.0, "post_filter")
    @t.root_segment.add_called_segment(s4)
    s4.end_trace 7.0
  end

  def test_exclusive_duration
    s1 = @t.root_segment.called_segments.first
    assert_equal 3.0, s1.duration
    assert_equal 2.0, s1.exclusive_duration
  end

  def test_count_the_segments
    assert_equal 4, @t.count_segments
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
newrelic_rpm-3.11.2.286 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.11.1.284 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.11.0.283 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.10.0.279 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.9.275 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.8.273 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.7.266 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.6.257 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.5.251 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.4.245 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.3.241 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.2.239 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.1.236 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.9.0.229 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.8.1.221 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.8.0.218 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.7.3.204 test/new_relic/transaction_sample_subtest_test.rb
newrelic_rpm-3.7.3.199 test/new_relic/transaction_sample_subtest_test.rb