Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

expose some of ruby-prof's measure modes

  • Loading branch information...
commit 083a401a70c1b515a08dfd07542a2431b2ffd366 1 parent c9d6076
@skaes authored
View
7 README
@@ -103,6 +103,13 @@ FILES
store profile data in a HTML file in directory $RAILS_PERF_DATA
file name is computed from date and benchmark name as described above
but has a .html extension instead of .txt
+ - a number of options to steer ruby-prof are available:
+ -ruby_prof=number[/number]
+ sets threshold and min_percent for ruby-prof (defaults to 0.1/1)
+ -profile_type=stack|grind|flat|graph|multi
+ selects the profile format (defaults to stack)
+ -measure_mode=process_time|wall_time|cpu_time|allocations|memory
+ selects what to measure (default to wall_time)
perf_plot [ options ] file1 file2 ...
- plot performance data from raw performance files using gruff or gnuplot
View
11 lib/railsbench/railsbenchmark.rb
@@ -296,7 +296,16 @@ def run_urls_without_benchmark(gc_stats)
$stderr = File.open(benchmark_file, "w")
end
require 'ruby-prof'
- RubyProf.measure_mode = RubyProf::WALL_TIME
+ measure_mode = "WALL_TIME"
+ ARGV.each{|arg| measure_mode=$1.upcase if arg =~ /-measure_mode=([^ ]*)/ }
+ if %w(PROCESS_TIME WALL_TIME CPU_TIME ALLOCATIONS MEMORY).include?(measure_mode)
+ RubyProf.measure_mode = RubyProf.const_get measure_mode
+ GC.eanable_stats if measure_mode == "memory"
+ else
+ $stderr = STDERR
+ $stderr.puts "unsupported ruby_prof measure mode: #{measure_mode}"
+ exit(-1)
+ end
RubyProf.start
end
rescue LoadError
View
2  lib/railsbench/version.rb
@@ -2,7 +2,7 @@ module Railsbench #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 9
- TINY = 5
+ TINY = 6
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
14 railsbench.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{railsbench}
- s.version = "0.9.5"
+ s.version = "0.9.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Stefan Kaes"]
- s.date = %q{2009-06-25}
+ s.date = %q{2009-08-16}
s.default_executable = %q{railsbench}
s.description = %q{rails benchmarking tools}
s.email = %q{skaes@railsexpress.de}
@@ -17,20 +17,20 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--main", "README.txt"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{railsbench}
- s.rubygems_version = %q{1.3.1}
+ s.rubygems_version = %q{1.3.3}
s.summary = %q{rails benchmarking tools}
s.test_files = ["test/railsbench_test.rb"]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
+ s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<hoe>, [">= 1.8.2"])
+ s.add_development_dependency(%q<hoe>, [">= 1.12.2"])
else
- s.add_dependency(%q<hoe>, [">= 1.8.2"])
+ s.add_dependency(%q<hoe>, [">= 1.12.2"])
end
else
- s.add_dependency(%q<hoe>, [">= 1.8.2"])
+ s.add_dependency(%q<hoe>, [">= 1.12.2"])
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.