Sha256: f15342bbc154184052b8ccf32d973668d35c06047f698c3a29fa4cd81b0791e9

Contents?: true

Size: 788 Bytes

Versions: 12

Compression:

Stored size: 788 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require File.expand_path('../test_helper', __FILE__)

class MeasureGCTimeTest < Test::Unit::TestCase
  include MemoryTestHelper

  def test_gc_time_mode
    RubyProf::measure_mode = RubyProf::GC_TIME
    assert_equal(RubyProf::GC_TIME, RubyProf::measure_mode)
  end

  def test_gc_time_enabled_defined
    assert(defined?(RubyProf::GC_TIME_ENABLED))
  end

  if RubyProf::GC_TIME_ENABLED
    def test_gc_time
      RubyProf::measure_mode = RubyProf::GC_TIME
      RubyProf.enable_gc_stats_if_needed

      t = RubyProf.measure_gc_time
      assert_kind_of Float, t

      GC.start

      u = RubyProf.measure_gc_time
      assert u > t, [t, u].inspect

      memory_test_helper
    ensure
      RubyProf.disable_gc_stats_if_needed
    end
  end
end

Version data entries

12 entries across 10 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/ruby-prof-0.15.1/test/measure_gc_time_test.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/ruby-prof-0.15.1/test/measure_gc_time_test.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/ruby-prof-0.15.1/test/measure_gc_time_test.rb
ruby-prof-0.15.2 test/measure_gc_time_test.rb
ruby-prof-0.15.1 test/measure_gc_time_test.rb
ruby-prof-0.15.0 test/measure_gc_time_test.rb
ruby-prof-0.14.2 test/measure_gc_time_test.rb
ruby-prof-0.14.1 test/measure_gc_time_test.rb
ruby-prof-0.14.0 test/measure_gc_time_test.rb
ruby-prof-0.13.1 test/measure_gc_time_test.rb
ruby-prof-0.13.0 test/measure_gc_time_test.rb
ruby-prof-0.12.2 test/measure_gc_time_test.rb