Sha256: 9f36875e41488d6e6b0187383af0ec09352b5854221220e0a1243ff3060d8efc

Contents?: true

Size: 1.41 KB

Versions: 268

Compression:

Stored size: 1.41 KB

Contents

module ActiveSupport
  module Testing
    module Performance
      module Metrics
        class Base
          protected
            # Ruby 1.8 + ruby-prof wrapper (enable/disable stats for Benchmarker)
            if GC.respond_to?(:enable_stats)
              def with_gc_stats
                GC.enable_stats
                GC.start
                yield
              ensure
                GC.disable_stats
              end
            end
        end

        class Memory < DigitalInformationUnit
          # Ruby 1.8 + ruby-prof wrapper
          if RubyProf.respond_to?(:measure_memory)
            def measure
              RubyProf.measure_memory
            end
          end
        end

        class Objects < Amount
          # Ruby 1.8 + ruby-prof wrapper
          if RubyProf.respond_to?(:measure_allocations)
            def measure
              RubyProf.measure_allocations
            end
          end
        end

        class GcRuns < Amount
          # Ruby 1.8 + ruby-prof wrapper
          if RubyProf.respond_to?(:measure_gc_runs)
            def measure
              RubyProf.measure_gc_runs
            end
          end
        end

        class GcTime < Time
          # Ruby 1.8 + ruby-prof wrapper
          if RubyProf.respond_to?(:measure_gc_time)
            def measure
              RubyProf.measure_gc_time / 1000.0 / 1000.0
            end
          end
        end
      end
    end
  end
end

Version data entries

268 entries across 224 versions & 25 rubygems

Version Path
activesupport-3.2.10 lib/active_support/testing/performance/ruby/mri.rb
activesupport-3.1.9 lib/active_support/testing/performance/ruby/mri.rb
classiccms-0.6.9 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.3 vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
jquery_regex-0.0.1 vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/testing/performance/ruby/mri.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/testing/performance/ruby/mri.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/testing/performance/ruby/mri.rb
challah-rolls-0.2.0 vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb
challah-rolls-0.2.0 vendor/bundle/gems/activesupport-3.2.7/lib/active_support/testing/performance/ruby/mri.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/activesupport-3.2.8/lib/active_support/testing/performance/ruby/mri.rb
challah-rolls-0.2.0 vendor/bundle/gems/activesupport-3.2.8/lib/active_support/testing/performance/ruby/mri.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/testing/performance/ruby/mri.rb