Permalink
Browse files

added basic structure for jruby

  • Loading branch information...
1 parent 3872cc4 commit 84fe2b8b4266f5ef4e3e5f2880a18b8e44a070f0 @goncalossilva goncalossilva committed Mar 26, 2011
@@ -111,6 +111,10 @@ def output_filename
# overridden by each implementation
class Profiler < Performer
+ def initialize(*args)
+ super
+ end
+
def run; end
def report; end
def record; end
@@ -272,8 +276,9 @@ def measure; end
RUBY_ENGINE = 'ruby' unless defined?(RUBY_ENGINE) # mri 1.8
case RUBY_ENGINE
- when 'ruby' then require 'active_support/testing/performance/ruby'
- when 'rbx' then require 'active_support/testing/performance/rubinius'
+ when 'ruby' then require 'active_support/testing/performance/ruby'
+ when 'rbx' then require 'active_support/testing/performance/rubinius'
+ when 'jruby' then require 'active_support/testing/performance/jruby'
else
$stderr.puts 'Your ruby interpreter is not supported for benchmarking.'
exit
@@ -0,0 +1,70 @@
+module ActiveSupport
+ module Testing
+ module Performance
+ protected
+ def run_gc
+ GC.start
+ end
+
+ class Performer; end
+
+ class Profiler < Performer
+ def run
+ end
+
+ def report
+ end
+
+ def record
+ end
+
+ protected
+ def output_filename(printer_class)
+ end
+ end
+
+ module Metrics
+ class Base
+ def profile
+ end
+
+ protected
+ def with_gc_stats
+ end
+
+ class Time < Base; end
+
+ class ProcessTime < Time
+ def measure; 0; end
+ end
+
+ class WallTime < Time
+ def measure
+ super
+ end
+ end
+
+ class CpuTime < Time
+ def measure; 0; end
+ end
+
+ class Memory < Base
+ def measure; 0; end
+ end
+
+ class Objects < Amount
+ def measure; 0; end
+ end
+
+ class GcRuns < Amount
+ def measure; 0; end
+ end
+
+ class GcTime < Time
+ def measure; 0; end
+ end
+ end
+ end
+ end
+ end
+end
@@ -16,11 +16,7 @@ def run_gc
class Performer; end
- class Profiler < Performer
- def initialize(*args)
- super
- end
-
+ class Profiler < Performer
def run
@profiler = Rubinius::Profiler::Instrumenter.new
@@ -72,7 +68,6 @@ def profile
end
protected
- # overridden by each implementation
def with_gc_stats
@loopback = Rubinius::Agent.loopback
GC.run(true)

0 comments on commit 84fe2b8

Please sign in to comment.