Sha256: b4b192019448ce8afd368c9745dd64bf8fdc2538dc2ada85a021635db38b8839

Contents?: true

Size: 1.3 KB

Versions: 268

Compression:

Stored size: 1.3 KB

Contents

module ActiveSupport
  module Testing
    module Performance
      module Metrics
        class Base
          protected
            # Ruby 1.9 with GC::Profiler
            if defined?(GC::Profiler)
              def with_gc_stats
                GC::Profiler.enable
                GC.start
                yield
              ensure
                GC::Profiler.disable
              end
            end
        end

        class Memory < DigitalInformationUnit
          # Ruby 1.9 + GCdata patch
          if GC.respond_to?(:malloc_allocated_size)
            def measure
              GC.malloc_allocated_size
            end
          end
        end

        class Objects < Amount
          # Ruby 1.9 + GCdata patch
          if GC.respond_to?(:malloc_allocations)
            def measure
              GC.malloc_allocations
            end
          end
        end

        class GcRuns < Amount
          # Ruby 1.9
          if GC.respond_to?(:count)
            def measure
              GC.count
            end
          end
        end

        class GcTime < Time
          # Ruby 1.9 with GC::Profiler
          if defined?(GC::Profiler) && GC::Profiler.respond_to?(:total_time)
            def measure
              GC::Profiler.total_time
            end
          end
        end
      end
    end
  end
end

Version data entries

268 entries across 224 versions & 25 rubygems

Version Path
font-awesome-rails-3.1.1.2 vendor/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/testing/performance/ruby/yarv.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/testing/performance/ruby/yarv.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/testing/performance/ruby/yarv.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
font-awesome-rails-3.1.1.1 vendor/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/testing/performance/ruby/yarv.rb
challah-1.0.0.beta3 vendor/bundle/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
challah-1.0.0.beta2 vendor/bundle/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
challah-1.0.0.beta vendor/bundle/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
challah-1.0.0.beta vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby/yarv.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/performance/ruby/yarv.rb
activesupport-3.2.13 lib/active_support/testing/performance/ruby/yarv.rb
activesupport-3.1.12 lib/active_support/testing/performance/ruby/yarv.rb
activesupport-3.2.13.rc2 lib/active_support/testing/performance/ruby/yarv.rb
activesupport-3.2.13.rc1 lib/active_support/testing/performance/ruby/yarv.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/testing/performance/ruby/yarv.rb