aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/performance.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/testing/performance.rb')
-rw-r--r--activesupport/lib/active_support/testing/performance.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb
index 1f8a5eec8f..5f2027eb3b 100644
--- a/activesupport/lib/active_support/testing/performance.rb
+++ b/activesupport/lib/active_support/testing/performance.rb
@@ -288,7 +288,7 @@ module ActiveSupport
end
class CpuTime < Time
- Mode = RubyProf::CPU_TIME
+ Mode = RubyProf::CPU_TIME if RubyProf.const_defined?(:CPU_TIME)
def initialize(*args)
# FIXME: yeah my CPU is 2.33 GHz
@@ -302,7 +302,7 @@ module ActiveSupport
end
class Memory < Base
- Mode = RubyProf::MEMORY
+ Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY)
# ruby-prof wrapper
if RubyProf.respond_to?(:measure_memory)
@@ -335,7 +335,7 @@ module ActiveSupport
end
class Objects < Base
- Mode = RubyProf::ALLOCATIONS
+ Mode = RubyProf::ALLOCATIONS if RubyProf.const_defined?(:ALLOCATIONS)
if RubyProf.respond_to?(:measure_allocations)
def measure
@@ -353,7 +353,7 @@ module ActiveSupport
end
class GcRuns < Base
- Mode = RubyProf::GC_RUNS
+ Mode = RubyProf::GC_RUNS if RubyProf.const_defined?(:GC_RUNS)
if RubyProf.respond_to?(:measure_gc_runs)
def measure
@@ -375,7 +375,7 @@ module ActiveSupport
end
class GcTime < Base
- Mode = RubyProf::GC_TIME
+ Mode = RubyProf::GC_TIME if RubyProf.const_defined?(:GC_TIME)
if RubyProf.respond_to?(:measure_gc_time)
def measure