sims/performance/performance.rake in rubyrep-1.2.0 vs sims/performance/performance.rake in rubyrep-2.0.0
- old
+ new
@@ -1,10 +1,10 @@
require 'rake'
require 'benchmark'
-require File.dirname(__FILE__) + '/../sim_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../sim_helper')
# Prepares the database schema for the performance tests.
def prepare_schema
session = RR::Session.new
@@ -30,24 +30,24 @@
BIG_SCAN_SAME = 95
BIG_SCAN_MODIFIED = BIG_SCAN_SAME + 3
BIG_SCAN_LEFT_ONLY = BIG_SCAN_MODIFIED + 1 # difference to 100% will be right_only records
def big_scan_columns
- @@big_scan_columns ||= nil
- unless @@big_scan_columns
+ @big_scan_columns ||= nil
+ unless @big_scan_columns
session = RR::Session.new
- @@big_scan_columns = session.left.column_names('big_scan')
+ @big_scan_columns = session.left.column_names('big_scan')
end
- @@big_scan_columns
+ @big_scan_columns
end
def text_columns
- @@text_columns ||= big_scan_columns.select {|column_name| column_name =~ /^text/}
+ @text_columns ||= big_scan_columns.select {|column_name| column_name =~ /^text/}
end
def number_columns
- @@number_columns ||= big_scan_columns.select {|column_name| column_name =~ /^number/}
+ @number_columns ||= big_scan_columns.select {|column_name| column_name =~ /^number/}
end
def random_attributes
attributes = {}
text_columns.each {|column_name| attributes[column_name] = "text#{rand(1000)}"}
@@ -191,39 +191,19 @@
prepare
end
desc "Runs the big_scan simulation"
task :scan do
- Spec::Runner::CommandLine.run(
- Spec::Runner::OptionParser.parse(
- ['--options', "spec/spec.opts", "./sims/performance/big_scan_spec.rb"],
- $stdout, $stderr))
+ system "rspec sims/performance/big_scan_spec.rb"
end
desc "Runs the big_sync simulation"
task :sync do
- Spec::Runner::CommandLine.run(
- Spec::Runner::OptionParser.parse(
- ['--options', "spec/spec.opts", "./sims/performance/big_sync_spec.rb"],
- $stdout, $stderr))
+ system "rspec sims/performance/big_sync_spec.rb"
end
desc "Runs the big_rep simulation"
task :rep do
- Spec::Runner::CommandLine.run(
- Spec::Runner::OptionParser.parse(
- ['--options', "spec/spec.opts", "./sims/performance/big_rep_spec.rb"],
- $stdout, $stderr))
+ system "rspec sims/performance/big_rep_spec.rb"
end
-
- begin
- require 'ruby-prof/task'
- RubyProf::ProfileTask.new do |t|
- t.test_files = FileList["./sims/performance/*_spec.rb"]
- t.output_dir = 'profile'
- t.printer = :flat
- t.min_percent = 1
- end
- rescue LoadError
- end
end
-end
\ No newline at end of file
+end