Skip to content

Commit

Permalink
Add files for crash reproductions.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jun 15, 2011
0 parents commit 56bc9f7
Show file tree
Hide file tree
Showing 6 changed files with 303,205 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README
@@ -0,0 +1,7 @@
To reproduce the NoClassDefFound issue:

java -jar jruby.jar --1.9 -I. bench_etl.rb

To reproduce the crash:

java -XX:MaxInlineSize=150 -XX:InlineSmallCode=3000 -Xbootclasspath/a:jruby.jar -Djruby.native.enabled=false org.jruby.Main -X+C --1.9 bench_etl.rb
40 changes: 40 additions & 0 deletions bench_etl.rb
@@ -0,0 +1,40 @@
require 'date'

start = Time.now
#
# Download from http://mikeperham.com/sample_accounts.csv.bz2
#
file = File.open("sample_accounts.csv")
sql_file = File.new("accounts_sql.sql", "w")
sql_file.puts "insert into mailer_account_data (account_number,amount_due, due_on, points, minimum_amount_due, available_credit,
last_payment, last_payment_received_on, expires_on, balance, apr) values "

idx = 0
sql_line = ""

file.each_line do |line|
fields = line.split(',')

account_number = fields[0]
amount_due = sprintf('%.2f', Float(fields[1]))

due_on = Date.parse(fields[2], true)
points = fields[3]
minimum_amount_due = sprintf('%.2f', Float(fields[4]))
available_credit = sprintf('%.2f', Float(fields[5]))
last_payment = sprintf('%.2f', Float(fields[6]))
last_payment_received_on = Date.parse(fields[7], true)
expires_on = Date.parse(fields[8], true)
balance = sprintf('%.2f', Float(fields[9]))
apr = fields[10]

sql_file.puts "#{sql_line}(#{account_number},#{amount_due},'#{due_on}',#{points},#{minimum_amount_due},#{available_credit},#{last_payment},'#{last_payment_received_on}','#{expires_on}',#{balance},#{apr})"

sql_line = ","
end

sql_file.close

duration = (Time.now - start).to_i

puts "Transform time : #{duration.to_s}"

0 comments on commit 56bc9f7

Please sign in to comment.