Sha256: 4b32d5063e362cedc91dd4b741a554494eaf8b0c03e65fea0d59c9441138fc93

Contents?: true

Size: 1.48 KB

Versions: 38

Compression:

Stored size: 1.48 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.

require File.expand_path(File.join(File.dirname(__FILE__),'..', '..','..','test_helper'))
require 'new_relic/agent/vm/mri_vm'

unless NewRelic::LanguageSupport.jruby? || NewRelic::LanguageSupport.rubinius?
  module NewRelic
    module Agent
      module VM
        class MriVMTest < Minitest::Test
          def setup
            @snap = Snapshot.new
            @vm = MriVM.new
          end

          unless RUBY_VERSION < '1.9.2'
            def test_gather_gc_time_sets_gc_total_time_if_gc_profiler_is_enabled
              NewRelic::LanguageSupport.stubs(:gc_profiler_enabled?).returns(true)
              @vm.gather_gc_time(@snap)
              refute_nil @snap.gc_total_time
            end
          end

          def test_gather_gc_time_does_not_set_gc_total_time_if_gc_profiler_is_disabled
            NewRelic::LanguageSupport.stubs(:gc_profiler_enabled?).returns(false)
            @vm.gather_gc_time(@snap)
            assert_nil @snap.gc_total_time
          end

          def test_gather_stats_records_gc_time_if_available
            NewRelic::Agent.instance.monotonic_gc_profiler.stubs(:total_time_s).returns(999)
            NewRelic::LanguageSupport.stubs(:gc_profiler_enabled?).returns(true)
            @vm.gather_stats(@snap)
            assert_equal(999, @snap.gc_total_time)
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
newrelic_rpm-3.18.1.330 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.18.0.329 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.17.2.327 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.17.1.326 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.17.0.325 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.16.3.323 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.16.2.321 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.16.1.320 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.16.0.318 test/new_relic/agent/vm/mri_vm_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.15.2.317 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.15.1.316 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.15.0.314 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.14.3.313 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.14.2.312 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.14.1.311 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.14.0.305 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.13.2.302 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.13.1.300 test/new_relic/agent/vm/mri_vm_test.rb
newrelic_rpm-3.13.0.299 test/new_relic/agent/vm/mri_vm_test.rb